需求变更:申辩成立重新走修改
parent
d4ca975869
commit
d21c39108f
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add";
|
||||||
|
|
||||||
|
function Edit(props) {
|
||||||
|
return (<Add useTemporaryStorage={false} {...props} />);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Edit;
|
||||||
|
|
@ -23,6 +23,7 @@ function List(props) {
|
||||||
const [defenseHandlingModalOpen, setDefenseHandlingModalOpen] = useState(false);
|
const [defenseHandlingModalOpen, setDefenseHandlingModalOpen] = useState(false);
|
||||||
const [defenseRecordModalOpen, setDefenseRecordModalOpen] = useState(false);
|
const [defenseRecordModalOpen, setDefenseRecordModalOpen] = useState(false);
|
||||||
const [currentId, setCurrentId] = useState("");
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
const [currentInspectionId, setCurrentInspectionId] = useState("");
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||||
form,
|
form,
|
||||||
|
|
@ -86,6 +87,7 @@ function List(props) {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDefenseHandlingModalOpen(true);
|
setDefenseHandlingModalOpen(true);
|
||||||
setCurrentId(record.id);
|
setCurrentId(record.id);
|
||||||
|
setCurrentInspectionId(record.inspectionId);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
申辩处理
|
申辩处理
|
||||||
|
|
@ -109,6 +111,8 @@ function List(props) {
|
||||||
{defenseHandlingModalOpen && (
|
{defenseHandlingModalOpen && (
|
||||||
<DefenseHandlingModal
|
<DefenseHandlingModal
|
||||||
id={currentId}
|
id={currentId}
|
||||||
|
inspectionId={currentInspectionId}
|
||||||
|
history={props.history}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setDefenseHandlingModalOpen(false);
|
setDefenseHandlingModalOpen(false);
|
||||||
setCurrentId("");
|
setCurrentId("");
|
||||||
|
|
@ -134,6 +138,10 @@ function DefenseHandlingModalComponent(props) {
|
||||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||||
|
|
||||||
const onSubmit = async (values) => {
|
const onSubmit = async (values) => {
|
||||||
|
if (values.status === "1") {
|
||||||
|
props.history.push(`./edit?id=${props.id}&inspectionId=${props.inspectionId}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
let signature = "";
|
let signature = "";
|
||||||
if (values.signature) {
|
if (values.signature) {
|
||||||
const { filePath } = await uploadFile({
|
const { filePath } = await uploadFile({
|
||||||
|
|
@ -164,8 +172,11 @@ function DefenseHandlingModalComponent(props) {
|
||||||
loading={uploadFileLoading || props.inspection.defenseLoading}
|
loading={uploadFileLoading || props.inspection.defenseLoading}
|
||||||
form={form}
|
form={form}
|
||||||
span={24}
|
span={24}
|
||||||
labelCol={{ span: 10 }}
|
labelCol={{ span: 12 }}
|
||||||
showActionButtons={false}
|
showActionButtons={false}
|
||||||
|
values={{
|
||||||
|
status: "2",
|
||||||
|
}}
|
||||||
onFinish={onSubmit}
|
onFinish={onSubmit}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
|
|
@ -247,6 +258,8 @@ function DefenseRecordModalComponent(props) {
|
||||||
>
|
>
|
||||||
<Spin spinning={downloadFileLoading || getFileLoading}>
|
<Spin spinning={downloadFileLoading || getFileLoading}>
|
||||||
<Table
|
<Table
|
||||||
|
options={false}
|
||||||
|
disabledResizer={true}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "申辩时间", dataIndex: "createTime", width: 200 },
|
{ title: "申辩时间", dataIndex: "createTime", width: 200 },
|
||||||
{ title: "申辩描述", dataIndex: "content" },
|
{ title: "申辩描述", dataIndex: "content" },
|
||||||
|
|
@ -258,7 +271,7 @@ function DefenseRecordModalComponent(props) {
|
||||||
</>
|
</>
|
||||||
) },
|
) },
|
||||||
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
|
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
|
||||||
{ title: "申辩附件名称", dataIndex: "name", width: 200,render: (_, record) => record.files?.[0]?.fileName || "无" },
|
{ title: "申辩附件名称", dataIndex: "name", width: 200, render: (_, record) => record.files?.[0]?.fileName || "无" },
|
||||||
{ title: "申辩附件", dataIndex: "url", render: (_, record) => (
|
{ title: "申辩附件", dataIndex: "url", render: (_, record) => (
|
||||||
record.files?.[0]?.filePath && (
|
record.files?.[0]?.filePath && (
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
|
|
@ -309,9 +309,9 @@ function Add(props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isIdle)
|
if (isIdle && props.useTemporaryStorage !== false)
|
||||||
onSubmit(form.getFieldsValue(), 1);
|
onSubmit(form.getFieldsValue(), 1);
|
||||||
}, [isIdle]);
|
}, [isIdle, props.useTemporaryStorage]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
||||||
|
|
@ -325,14 +325,16 @@ function Add(props) {
|
||||||
loading={deleteFileLoading || getFileLoading || uploadFileLoading || props.inspection.inspectionLoading}
|
loading={deleteFileLoading || getFileLoading || uploadFileLoading || props.inspection.inspectionLoading}
|
||||||
onFinish={values => onSubmit(values, 0)}
|
onFinish={values => onSubmit(values, 0)}
|
||||||
extraActionButtons={[
|
extraActionButtons={[
|
||||||
<Button
|
props.useTemporaryStorage !== false && (
|
||||||
key="temporaryStorage"
|
<Button
|
||||||
onClick={() => {
|
key="temporaryStorage"
|
||||||
onSubmit(form.getFieldsValue(), 1);
|
onClick={() => {
|
||||||
}}
|
onSubmit(form.getFieldsValue(), 1);
|
||||||
>
|
}}
|
||||||
暂存
|
>
|
||||||
</Button>,
|
暂存
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
]}
|
]}
|
||||||
options={[
|
options={[
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,13 @@ function InspectionView(props) {
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const { data } = await props["inspectionView"]({ inspectionId: query.id });
|
const { data } = await props["inspectionView"]({ inspectionId: query.id });
|
||||||
for (let i = 0; i < data.content.length; i++) {
|
for (let i = 0; i < data.content.length; i++) {
|
||||||
const files = await getFile({
|
if (data.content[i].contentId) {
|
||||||
eqType: UPLOAD_FILE_TYPE_ENUM["140"],
|
const files = await getFile({
|
||||||
eqForeignKey: data.content[i].contentId,
|
eqType: UPLOAD_FILE_TYPE_ENUM["140"],
|
||||||
});
|
eqForeignKey: data.content[i].contentId,
|
||||||
data.content[i].files = files;
|
});
|
||||||
|
data.content[i].files = files;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data.inspectorVerificationList.forEach((item) => {
|
data.inspectorVerificationList.forEach((item) => {
|
||||||
setCurrentInspectorUserName(prev => [...prev, item.userName || ""]);
|
setCurrentInspectorUserName(prev => [...prev, item.userName || ""]);
|
||||||
|
|
@ -80,7 +82,7 @@ function InspectionView(props) {
|
||||||
<Descriptions
|
<Descriptions
|
||||||
column={2}
|
column={2}
|
||||||
bordered
|
bordered
|
||||||
styles={{ label: { width: 200 } }}
|
styles={{ label: { width: 200 }, content: { width: 500 } }}
|
||||||
items={[
|
items={[
|
||||||
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
|
{ label: "被检查单位", children: info.inspectedPartyConfirmation?.departmentName },
|
||||||
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
|
{ label: "被检查单位现场负责人", children: info.inspectedPartyConfirmation?.userName },
|
||||||
|
|
@ -98,7 +100,7 @@ function InspectionView(props) {
|
||||||
<Descriptions
|
<Descriptions
|
||||||
column={2}
|
column={2}
|
||||||
bordered
|
bordered
|
||||||
styles={{ label: { width: 200 } }}
|
styles={{ label: { width: 200 }, content: { width: 500 } }}
|
||||||
items={
|
items={
|
||||||
info.content.map(item =>
|
info.content.map(item =>
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Add from "~/pages/Container/BranchCompany/Inspection/Inspection/Add";
|
||||||
|
|
||||||
|
function Edit(props) {
|
||||||
|
return <Add searchType="all" source="4" useTemporaryStorage={false} {...props} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Edit;
|
||||||
Loading…
Reference in New Issue