feat
parent
487459a567
commit
04db2ccb7e
|
|
@ -16,6 +16,7 @@ const APPLY_TYPE_APPLICATION = 1;
|
||||||
export function toFilingListRow(data = {}) {
|
export function toFilingListRow(data = {}) {
|
||||||
return {
|
return {
|
||||||
id: asId(data.id),
|
id: asId(data.id),
|
||||||
|
filingId: data.filingId,
|
||||||
filingTerritoryCode: data.filingTerritoryCode,
|
filingTerritoryCode: data.filingTerritoryCode,
|
||||||
filingTerritoryName: data.filingTerritoryName,
|
filingTerritoryName: data.filingTerritoryName,
|
||||||
filingUnitName: data.filingUnitName,
|
filingUnitName: data.filingUnitName,
|
||||||
|
|
@ -181,9 +182,9 @@ export async function fetchQualChangeDetail(id) {
|
||||||
return fromSingleResponse(res, toFilingDetail);
|
return fromSingleResponse(res, toFilingDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchQualFilingChangeHistory(originFilingId) {
|
export async function fetchQualFilingChangeHistory(filingId) {
|
||||||
const res = await apiGet("/safetyEval/qual-filing-change/history", {
|
const res = await apiGet("/safetyEval/qual-filing-change/history", {
|
||||||
originFilingId: asId(originFilingId),
|
filingId: asId(filingId),
|
||||||
});
|
});
|
||||||
return fromSingleResponse(res, toChangeHistory);
|
return fromSingleResponse(res, toChangeHistory);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ console.log(historyRecord);
|
||||||
/>
|
/>
|
||||||
<ChangeHistoryModal
|
<ChangeHistoryModal
|
||||||
open={!!historyRecord}
|
open={!!historyRecord}
|
||||||
originFilingId={historyRecord?.filingId}
|
filingId={historyRecord?.filingId}
|
||||||
onCancel={() => setHistoryRecord(null)}
|
onCancel={() => setHistoryRecord(null)}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,21 @@ import { Modal, Table } from "antd";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { fetchQualFilingChangeHistory } from "~/api/qualFiling";
|
import { fetchQualFilingChangeHistory } from "~/api/qualFiling";
|
||||||
|
|
||||||
export default function ChangeHistoryModal({ open, originFilingId, onCancel }) {
|
export default function ChangeHistoryModal({ open, filingId, onCancel }) {
|
||||||
console.log(originFilingId);
|
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [records, setRecords] = useState([]);
|
const [records, setRecords] = useState([]);
|
||||||
const [changeCount, setChangeCount] = useState(0);
|
const [changeCount, setChangeCount] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!open || !originFilingId) {
|
if (!open || !filingId) {
|
||||||
setRecords([]);
|
setRecords([]);
|
||||||
setChangeCount(0);
|
setChangeCount(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
fetchQualFilingChangeHistory(originFilingId)
|
fetchQualFilingChangeHistory(filingId)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -33,7 +33,7 @@ export default function ChangeHistoryModal({ open, originFilingId, onCancel }) {
|
||||||
return () => {
|
return () => {
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
};
|
};
|
||||||
}, [open, originFilingId]);
|
}, [open, filingId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue