feat
parent
8e6c5c1b69
commit
19e4771369
|
|
@ -1,5 +1,13 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
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 { useEffect, useState } from "react";
|
||||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
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 { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
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 { NS_ORG_QUALIFICATION_CERT } from "~/enumerate/namespace";
|
||||||
import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions";
|
import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions";
|
||||||
import { formSelectField } from "~/utils/enterpriseForm";
|
import { formSelectField } from "~/utils/enterpriseForm";
|
||||||
|
|
@ -124,6 +134,18 @@ function QualificationCertPage(props) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
extra={
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={<AddIcon />}
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId("");
|
||||||
|
setAddModalOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增证书
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<SearchForm
|
<SearchForm
|
||||||
style={{ marginBottom: 24 }}
|
style={{ marginBottom: 24 }}
|
||||||
|
|
@ -131,7 +153,11 @@ function QualificationCertPage(props) {
|
||||||
loading={loading}
|
loading={loading}
|
||||||
formLine={[
|
formLine={[
|
||||||
<Form.Item key="likeCertName" name="likeCertName">
|
<Form.Item key="likeCertName" name="likeCertName">
|
||||||
<ControlWrapper.Input label="证书名称" placeholder="请输入证书名称" allowClear />
|
<ControlWrapper.Input
|
||||||
|
label="证书名称"
|
||||||
|
placeholder="请输入证书名称"
|
||||||
|
allowClear
|
||||||
|
/>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="validDate" name="validDate">
|
<Form.Item key="validDate" name="validDate">
|
||||||
<ControlWrapper.DatePicker.RangePicker label="证书有效期" />
|
<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
|
<Table
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
columns={[
|
columns={[
|
||||||
|
|
@ -170,19 +183,25 @@ function QualificationCertPage(props) {
|
||||||
{
|
{
|
||||||
title: "证书有效期",
|
title: "证书有效期",
|
||||||
width: 220,
|
width: 220,
|
||||||
render: (_, record) => `${record.validStartDate ?? ""} ~ ${record.validEndDate ?? ""}`,
|
render: (_, record) =>
|
||||||
|
`${record.validStartDate ?? ""} ~ ${record.validEndDate ?? ""}`,
|
||||||
},
|
},
|
||||||
{ title: "证书编号", dataIndex: "certNo" },
|
{ title: "证书编号", dataIndex: "certNo" },
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "状态",
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (_, record) => (isQualificationEnabled(record) ? "启用" : "禁用"),
|
render: (_, record) =>
|
||||||
|
isQualificationEnabled(record) ? "启用" : "禁用",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "照片",
|
title: "照片",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (_, record) =>
|
render: (_, record) =>
|
||||||
record.certImgFiles?.length ? <CertTooltipPreviewImg files={record.certImgFiles} /> : <span>无</span>,
|
record.certImgFiles?.length ? (
|
||||||
|
<CertTooltipPreviewImg files={record.certImgFiles} />
|
||||||
|
) : (
|
||||||
|
<span>无</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
|
|
@ -303,8 +322,13 @@ function CertFormModal({
|
||||||
}
|
}
|
||||||
const data = { ...res.data };
|
const data = { ...res.data };
|
||||||
data.issueDate = toDayjs(data.issueDate);
|
data.issueDate = toDayjs(data.issueDate);
|
||||||
data.validDate = [toDayjs(data.validStartDate), toDayjs(data.validEndDate)];
|
data.validDate = [
|
||||||
data.certImgs = data.certImgFiles?.length ? data.certImgFiles : mockUploadFileList("证书图片.jpg");
|
toDayjs(data.validStartDate),
|
||||||
|
toDayjs(data.validEndDate),
|
||||||
|
];
|
||||||
|
data.certImgs = data.certImgFiles?.length
|
||||||
|
? data.certImgFiles
|
||||||
|
: mockUploadFileList("证书图片.jpg");
|
||||||
form.setFieldsValue(data);
|
form.setFieldsValue(data);
|
||||||
setDetailLoading(false);
|
setDetailLoading(false);
|
||||||
|
|
||||||
|
|
@ -376,10 +400,15 @@ function CertFormModal({
|
||||||
showActionButtons={false}
|
showActionButtons={false}
|
||||||
onFinish={handleSubmit}
|
onFinish={handleSubmit}
|
||||||
options={[
|
options={[
|
||||||
formSelectField("certType", "证照类型", QUALIFICATION_INDUSTRY_OPTIONS, {
|
formSelectField(
|
||||||
rules: [{ required: true, message: "请选择证照类型" }],
|
"certType",
|
||||||
colProps: { span: 24 },
|
"证照类型",
|
||||||
}),
|
QUALIFICATION_INDUSTRY_OPTIONS,
|
||||||
|
{
|
||||||
|
rules: [{ required: true, message: "请选择证照类型" }],
|
||||||
|
colProps: { span: 24 },
|
||||||
|
},
|
||||||
|
),
|
||||||
{
|
{
|
||||||
name: "certName",
|
name: "certName",
|
||||||
label: "证书名称",
|
label: "证书名称",
|
||||||
|
|
@ -405,7 +434,10 @@ function CertFormModal({
|
||||||
name: "validDate",
|
name: "validDate",
|
||||||
label: "证书有效期",
|
label: "证书有效期",
|
||||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||||
rules: [{ required: true, message: "请选择证书有效期" }, dateRangeRule()],
|
rules: [
|
||||||
|
{ required: true, message: "请选择证书有效期" },
|
||||||
|
dateRangeRule(),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "remark",
|
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));
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,11 @@ function EnterpriseInfo(props) {
|
||||||
if (!orgInfoId) {
|
if (!orgInfoId) {
|
||||||
props.orgInfoGet().then((res) => {
|
props.orgInfoGet().then((res) => {
|
||||||
setOrgInfoId(res?.data?.id);
|
setOrgInfoId(res?.data?.id);
|
||||||
|
sessionStorage.setItem("orgInfoId", res?.data?.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
console.log(props.location.pathname);
|
|
||||||
|
|
||||||
if(props.location.pathname.includes('EnterpriseInfo/OrgInfo')){
|
if(props.location.pathname.includes('EnterpriseInfo/OrgInfo')){
|
||||||
return props.children;
|
return props.children;
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,7 @@ function FilingFormPage(props) {
|
||||||
const detailRef = useRef(null);
|
const detailRef = useRef(null);
|
||||||
const readOnly = query.readOnly;
|
const readOnly = query.readOnly;
|
||||||
|
|
||||||
const listMode =
|
|
||||||
mode === FILING_FORM_MODE.FILED
|
|
||||||
? "filed"
|
|
||||||
: mode === FILING_FORM_MODE.CHANGE
|
|
||||||
? "change"
|
|
||||||
: "application";
|
|
||||||
|
|
||||||
const saveActionHint =
|
const saveActionHint =
|
||||||
mode === FILING_FORM_MODE.FILED
|
mode === FILING_FORM_MODE.FILED
|
||||||
|
|
@ -143,28 +138,30 @@ function FilingFormPage(props) {
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
|
|
||||||
const currentDetail = collectCurrentDetail();
|
const currentDetail = collectCurrentDetail();
|
||||||
|
const word= mode === "change" ? "Change" : "";
|
||||||
const body = {
|
const body = {
|
||||||
[`qualFiling${mode === "change" ? "Change" : ""}AddCmd`]: {
|
[`qualFiling${word}AddCmd`]: {
|
||||||
...currentDetail,
|
...currentDetail,
|
||||||
filingStatusCode: config.isSaveDraft ? 5 : 2,
|
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) {
|
if (params.materials) {
|
||||||
body[`qualFilingMaterial${mode === "change" ? "Change" : ""}AddCmds`] = params.materials;
|
body[`qualFilingMaterial${word}AddCmds`] = params.materials;
|
||||||
delete params.materials;
|
delete params.materials;
|
||||||
}
|
}
|
||||||
if (params.personnelList) {
|
if (params.personnelList) {
|
||||||
body[`qualFilingPersonnel${mode === "change" ? "Change" : ""}AddCmds`] = params.personnelList;
|
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList;
|
||||||
delete params.personnelList;
|
delete params.personnelList;
|
||||||
}
|
}
|
||||||
if (params.equipmentList) {
|
if (params.equipmentList) {
|
||||||
body[`qualFilingEquipment${mode === "change" ? "Change" : ""}AddCmds`] = params.equipmentList;
|
body[`qualFilingEquipment${word}AddCmds`] = params.equipmentList;
|
||||||
delete params.equipmentList;
|
delete params.equipmentList;
|
||||||
}
|
}
|
||||||
if (params.commitment) {
|
if (params.commitment) {
|
||||||
body[`qualFilingCommitment${mode === "change" ? "Change" : ""}AddCmd`] = params.commitment;
|
body[`qualFilingCommitment${word}AddCmd`] = params.commitment;
|
||||||
delete params.commitment;
|
delete params.commitment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ function QualApplication(props) {
|
||||||
if (!orgInfoId) {
|
if (!orgInfoId) {
|
||||||
props.orgInfoGet().then((res) => {
|
props.orgInfoGet().then((res) => {
|
||||||
setOrgInfoId(res?.data?.id);
|
setOrgInfoId(res?.data?.id);
|
||||||
|
sessionStorage.setItem("orgInfoId", res?.data?.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue