Merge remote-tracking branch 'origin/dev' into dev
commit
d92907de52
|
|
@ -1,338 +1,115 @@
|
||||||
/** 资质备案:接口定义与前后端字段适配 */
|
|
||||||
|
|
||||||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { fromPageResponse, fromSingleResponse, toPageQuery } from "../../utils/enterpriseInfo/adapter";
|
import { apiGet } from "../../utils/enterpriseInfo/http";
|
||||||
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../../utils/enterpriseInfo/http";
|
|
||||||
import { asId, normalizeQueryIds } from "../../utils/enterpriseInfo/idUtil";
|
|
||||||
import { formatDate, toApiDate, toDayjs } from "../../utils/dateFormat";
|
|
||||||
import { parseUploadFileList, resolveUploadFileId } from "../../utils/mockUpload";
|
|
||||||
|
|
||||||
// ─── 工具 ───
|
|
||||||
|
|
||||||
const APPLY_TYPE_APPLICATION = 1;
|
|
||||||
|
|
||||||
// ─── 字段映射:列表行 ───
|
|
||||||
|
|
||||||
export function toFilingListRow(data = {}) {
|
|
||||||
return {
|
|
||||||
id: asId(data.id),
|
|
||||||
filingId: data.filingId,
|
|
||||||
filingTerritoryCode: data.filingTerritoryCode,
|
|
||||||
filingTerritoryName: data.filingTerritoryName,
|
|
||||||
filingUnitName: data.filingUnitName,
|
|
||||||
filingNo: data.filingNo || (data.id ? String(data.id) : ""),
|
|
||||||
businessScope: data.businessScope,
|
|
||||||
filingStatusCode: data.filingStatusCode,
|
|
||||||
filingStatusName: data.filingStatusName,
|
|
||||||
applyTypeCode: data.applyTypeCode,
|
|
||||||
applyTypeName: data.applyTypeName,
|
|
||||||
changeCount: Number(data.changeCount ?? 0),
|
|
||||||
originFilingId: asId(data.originFilingId),
|
|
||||||
rejectReason: data.rejectReason,
|
|
||||||
submitTime: formatDate(data.submitTime),
|
|
||||||
approveTime: formatDate(data.approveTime),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function fromFilingBasicForm(values = {}) {
|
|
||||||
const territoryName = values.filingTerritoryName || values.filingTerritoryCode;
|
|
||||||
const unitTypeName = values.filingUnitTypeName || values.filingUnitTypeCode;
|
|
||||||
return normalizeQueryIds({
|
|
||||||
id: asId(values.id),
|
|
||||||
businessScope: values.businessScope,
|
|
||||||
filingTerritoryCode: territoryName,
|
|
||||||
filingTerritoryName: territoryName,
|
|
||||||
filingUnitName: values.filingUnitName,
|
|
||||||
filingUnitTypeCode: unitTypeName,
|
|
||||||
filingUnitTypeName: unitTypeName,
|
|
||||||
filingNo: values.filingNo,
|
|
||||||
registerAddress: values.registerAddress,
|
|
||||||
officeAddress: values.officeAddress,
|
|
||||||
creditCode: values.creditCode,
|
|
||||||
qualCertNo: values.qualCertNo,
|
|
||||||
legalPersonPhone: values.legalPersonPhone,
|
|
||||||
contactPhone: values.contactPhone,
|
|
||||||
infoDisclosureUrl: values.infoDisclosureUrl,
|
|
||||||
fixedAssetAmount: values.fixedAssetAmount,
|
|
||||||
workplaceArea: values.workplaceArea,
|
|
||||||
archiveRoomArea: values.archiveRoomArea,
|
|
||||||
fulltimeEvaluatorCount: values.fulltimeEvaluatorCount,
|
|
||||||
registeredEngineerCount: values.registeredEngineerCount,
|
|
||||||
unitIntro: values.unitIntro,
|
|
||||||
attachmentUrl: values.attachmentUrl,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── 字段映射:详情 ───
|
|
||||||
|
|
||||||
export function toFilingDetail(data = {}) {
|
|
||||||
return {
|
|
||||||
...data,
|
|
||||||
materials: (data.materials || []),
|
|
||||||
commitment: data.commitment ? toFilingCommitmentForm(data.commitment, data.filingUnitName) : null,
|
|
||||||
personnelList: (data.personnelList || []).map(toFilingPersonnelRow),
|
|
||||||
equipmentList: (data.equipmentList || []).map(toFilingEquipmentRow),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ─── 字段映射:承诺书 ───
|
|
||||||
|
|
||||||
export function parseCommitmentNames(content = "", filingUnitName = "") {
|
|
||||||
const withComma = String(content).match(/本人是(.+?),是(.+?)法定代表人/);
|
|
||||||
if (withComma) {
|
|
||||||
return {
|
|
||||||
legalRepName: withComma[1]?.trim() || "",
|
|
||||||
filingUnitName: withComma[2]?.trim() || filingUnitName || "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const legacy = String(content).match(/本人是(.+?)是(.+?)法定代表人/);
|
|
||||||
return {
|
|
||||||
legalRepName: legacy?.[1]?.trim() || "",
|
|
||||||
filingUnitName: legacy?.[2]?.trim() || filingUnitName || "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function toFilingCommitmentForm(data = {}, filingUnitName = "") {
|
|
||||||
const parsed = parseCommitmentNames(data.commitmentContent, filingUnitName);
|
|
||||||
const legalRepPersonnelId = data.legalRepPersonnelId ? String(asId(data.legalRepPersonnelId)) : "";
|
|
||||||
return {
|
|
||||||
id: asId(data.id),
|
|
||||||
filingId: asId(data.filingId),
|
|
||||||
commitmentContent: data.commitmentContent,
|
|
||||||
legalRepPersonnelId,
|
|
||||||
legalRepName: data.legalRepName || parsed.legalRepName,
|
|
||||||
filingUnitName: parsed.filingUnitName || filingUnitName,
|
|
||||||
legalRepSignatureUrl: data.legalRepSignatureUrl,
|
|
||||||
signDate: toDayjs(data.signDate),
|
|
||||||
signatureFiles: parseUploadFileList(data.legalRepSignatureUrl, "电子签名.jpg"),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function fromFilingCommitmentForm(values = {}, filingId) {
|
|
||||||
const personnelId = asId(values.legalRepPersonnelId);
|
|
||||||
return {
|
|
||||||
id: asId(values.id),
|
|
||||||
filingId: asId(filingId),
|
|
||||||
commitmentContent: values.commitmentContent,
|
|
||||||
legalRepSignatureUrl: values.legalRepSignatureUrl,
|
|
||||||
signDate: toApiDate(values.signDate),
|
|
||||||
legalRepPersonnelId: personnelId || null,
|
|
||||||
legalRepName: values.legalRepName || "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── 字段映射:人员 / 装备 ───
|
|
||||||
|
|
||||||
export function toFilingPersonnelRow(data = {}) {
|
|
||||||
const personName = data.personName || data.userName || data.staffName;
|
|
||||||
return {
|
|
||||||
id: asId(data.id),
|
|
||||||
filingId: asId(data.filingId),
|
|
||||||
sourcePersonnelId: asId(data.sourcePersonnelId),
|
|
||||||
personName,
|
|
||||||
userName: personName,
|
|
||||||
personTypeCode: data.personTypeCode,
|
|
||||||
personTypeName: data.personTypeName,
|
|
||||||
positionName: data.positionName,
|
|
||||||
titleName: data.titleName,
|
|
||||||
genderCode: data.genderCode,
|
|
||||||
genderName: data.genderName,
|
|
||||||
birthDate: data.birthDate,
|
|
||||||
joinWorkDate: data.joinWorkDate,
|
|
||||||
idCardNo: data.idCardNo,
|
|
||||||
currentAddress: data.currentAddress,
|
|
||||||
officeAddress: data.officeAddress,
|
|
||||||
educationCode: data.educationCode,
|
|
||||||
educationName: data.educationName,
|
|
||||||
graduateSchool: data.graduateSchool,
|
|
||||||
major: data.major,
|
|
||||||
qualScope: data.qualScope,
|
|
||||||
publications: data.publications,
|
|
||||||
professionalLevelCert: data.professionalLevelCert,
|
|
||||||
registerEngineerFlag: data.registerEngineerFlag,
|
|
||||||
abilityDeclaration: data.abilityDeclaration,
|
|
||||||
workExperience: data.workExperience,
|
|
||||||
proofMaterialUrl: data.proofMaterialUrl,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function toFilingEquipmentRow(data = {}) {
|
|
||||||
return {
|
|
||||||
id: asId(data.id),
|
|
||||||
filingId: asId(data.filingId),
|
|
||||||
sourceEquipmentId: asId(data.sourceEquipmentId),
|
|
||||||
deviceName: data.deviceName,
|
|
||||||
deviceModel: data.deviceModel,
|
|
||||||
manufacturer: data.manufacturer,
|
|
||||||
calibrationReportUrl: data.calibrationReportUrl,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// ─── 字段映射:变更历史 ───
|
|
||||||
|
|
||||||
export function toChangeHistory(data = {}) {
|
|
||||||
return {
|
|
||||||
changeCount: Number(data.changeCount ?? 0),
|
|
||||||
records: (data.records || []).map((item, index) => ({
|
|
||||||
id: asId(item.id),
|
|
||||||
index: index + 1,
|
|
||||||
changeItemName: item.changeItemName,
|
|
||||||
changeTime: formatDate(item.changeTime),
|
|
||||||
operatorName: item.operatorName,
|
|
||||||
})),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ─── 分页查询参数映射 ───
|
|
||||||
|
|
||||||
function toFilingPageQuery(params = {}) {
|
|
||||||
const { filingTerritoryName, filingTerritoryCode, filingStatus, ...rest } = params;
|
|
||||||
const query = toPageQuery(rest, {
|
|
||||||
filingUnitName: "filingUnitName",
|
|
||||||
filingNo: "filingNo",
|
|
||||||
applyTypeCode: "applyTypeCode",
|
|
||||||
});
|
|
||||||
const territory = filingTerritoryCode || filingTerritoryName;
|
|
||||||
if (territory) {
|
|
||||||
query.filingTerritoryCode = territory;
|
|
||||||
}
|
|
||||||
if (filingStatus !== undefined && filingStatus !== null && filingStatus !== "") {
|
|
||||||
query.filingStatusCode = Number(filingStatus);
|
|
||||||
}
|
|
||||||
return query;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ═══════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════
|
||||||
// 接口 Action
|
// 详情查询
|
||||||
// ═══════════════════════════════════════════════════
|
// ═══════════════════════════════════════════════════
|
||||||
|
|
||||||
export async function fetchQualFilingDetail(id) {
|
export async function fetchQualFilingDetail(id) {
|
||||||
const res = await apiGet("/safetyEval/qual-filing/detail", { id: asId(id) });
|
return apiGet("/safetyEval/qual-filing/detail", { id });
|
||||||
return fromSingleResponse(res, toFilingDetail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchQualChangeDetail(id) {
|
export async function fetchQualChangeDetail(id) {
|
||||||
const res = await apiGet("/safetyEval/qual-filing-change/detail", { id: asId(id) });
|
return apiGet("/safetyEval/qual-filing-change/detail", { id });
|
||||||
return fromSingleResponse(res, toFilingDetail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchQualFilingChangeHistory(filingId) {
|
export async function fetchQualFilingChangeHistory(filingId) {
|
||||||
const res = await apiGet("/safetyEval/qual-filing-change/history", {
|
return apiGet("/safetyEval/qual-filing-change/history", { filingId });
|
||||||
filingId: asId(filingId),
|
|
||||||
});
|
|
||||||
return fromSingleResponse(res, toChangeHistory);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const qualFilingPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
|
// ═══════════════════════════════════════════════════
|
||||||
const res = await apiGet("/safetyEval/qual-filing/page", toFilingPageQuery(params));
|
// 分页列表
|
||||||
return fromPageResponse(res, toFilingListRow);
|
// ═══════════════════════════════════════════════════
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingFiledPage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
|
export const qualFilingPage = declareRequest("qualFilingLoading", "Get > /safetyEval/qual-filing/page");
|
||||||
const res = await apiGet("/safetyEval/qual-filing/filed/page", toFilingPageQuery(params));
|
|
||||||
return fromPageResponse(res, toFilingListRow);
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingChangePage = declareRequest("qualFilingLoading", safePageResult(async (params) => {
|
export const qualFilingFiledPage = declareRequest("qualFilingLoading", "Get > /safetyEval/qual-filing/filed/page");
|
||||||
const res = await apiGet("/safetyEval/qual-filing-change/org/page", toFilingPageQuery(params));
|
|
||||||
return fromPageResponse(res, toFilingListRow);
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingDraft = declareRequest("qualFilingLoading", safeAction(async () => {
|
export const qualFilingChangePage = declareRequest("qualFilingLoading", "Get > /safetyEval/qual-filing-change/org/page");
|
||||||
const res = await apiPost("/safetyEval/qual-filing/draft?applyTypeCode=1", {});
|
|
||||||
return fromSingleResponse(res, toFilingListRow);
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingFiledDraft = declareRequest("qualFilingLoading", safeAction(async () => {
|
// ═══════════════════════════════════════════════════
|
||||||
const res = await apiPost("/safetyEval/qual-filing/filed/draft", {});
|
// 草稿 / 提交
|
||||||
return fromSingleResponse(res, toFilingListRow);
|
// ═══════════════════════════════════════════════════
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingSaveDraft = declareRequest("qualFilingLoading", safeAction(async (values) => {
|
export const qualFilingDraft = declareRequest(
|
||||||
const res = await apiPost("/safetyEval/qual-filing/save-draft", fromFilingBasicForm(values));
|
"qualFilingLoading",
|
||||||
return fromSingleResponse(res, toFilingListRow);
|
"Post > @/safetyEval/qual-filing/draft?applyTypeCode=1",
|
||||||
}));
|
);
|
||||||
|
|
||||||
export const qualFilingSubmit = declareRequest("qualFilingLoading", safeAction(async ({ id }) => {
|
export const qualFilingFiledDraft = declareRequest(
|
||||||
const res = await apiPost(`/safetyEval/qual-filing/submit?id=${encodeURIComponent(asId(id))}`, {});
|
"qualFilingLoading",
|
||||||
return fromSingleResponse(res, toFilingListRow);
|
"Post > @/safetyEval/qual-filing/filed/draft",
|
||||||
}));
|
);
|
||||||
|
|
||||||
export const qualFilingDelete = declareRequest("qualFilingLoading", safeAction(async ({ id }) => {
|
export const qualFilingSaveDraft = declareRequest(
|
||||||
return apiPostDelete("/safetyEval/qual-filing/delete", id);
|
"qualFilingLoading",
|
||||||
}));
|
"Post > @/safetyEval/qual-filing/save-draft",
|
||||||
|
);
|
||||||
|
|
||||||
export const qualFilingMaterialInitTemplate = declareRequest("qualFilingLoading", safeAction(async ({ filingId }) => {
|
export const qualFilingSubmit = declareRequest(
|
||||||
return apiPost(`/safetyEval/qual-filing-material/init-template?filingId=${encodeURIComponent(asId(filingId))}`, {});
|
"qualFilingLoading",
|
||||||
}));
|
"Post > @/safetyEval/qual-filing/submit",
|
||||||
|
);
|
||||||
|
|
||||||
export const qualFilingMaterialUpload = declareRequest("qualFilingLoading", safeAction(async ({ id, attachmentUrl, files }) => {
|
export const qualFilingDelete = declareRequest(
|
||||||
const url = attachmentUrl || resolveUploadFileId(files);
|
"qualFilingLoading",
|
||||||
const res = await apiPost("/safetyEval/qual-filing-material/upload", { id: asId(id), attachmentUrl: url });
|
"Post > @/safetyEval/qual-filing/delete",
|
||||||
return fromSingleResponse(res);
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingUploadAttachment = declareRequest("qualFilingLoading", safeAction(async ({ id, attachmentUrl, files }) => {
|
export const qualFilingMaterialInitTemplate = declareRequest(
|
||||||
const url = attachmentUrl || resolveUploadFileId(files);
|
"qualFilingLoading",
|
||||||
const res = await apiPost("/safetyEval/qual-filing/upload-attachment", { id: asId(id), attachmentUrl: url });
|
"Post > @/safetyEval/qual-filing-material/init-template",
|
||||||
return fromSingleResponse(res, toFilingListRow);
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingCommitmentSaveOrUpdate = declareRequest("qualFilingLoading", safeAction(async (values) => {
|
export const qualFilingMaterialUpload = declareRequest(
|
||||||
const payload = fromFilingCommitmentForm(values, values.filingId);
|
"qualFilingLoading",
|
||||||
const res = await apiPost("/safetyEval/qual-filing-commitment/save-or-update", payload);
|
"Post > @/safetyEval/qual-filing-material/upload",
|
||||||
return fromSingleResponse(res);
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingCommitmentUploadSignature = declareRequest("qualFilingLoading", safeAction(async ({ id, attachmentUrl, files }) => {
|
export const qualFilingUploadAttachment = declareRequest(
|
||||||
const url = attachmentUrl || resolveUploadFileId(files);
|
"qualFilingLoading",
|
||||||
const res = await apiPost("/safetyEval/qual-filing-commitment/upload-signature", { id: asId(id), attachmentUrl: url });
|
"Post > @/safetyEval/qual-filing/upload-attachment",
|
||||||
return fromSingleResponse(res);
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingPersonnelBatchAdd = declareRequest("qualFilingLoading", safeAction(async ({ filingId, sourcePersonnelIds }) => {
|
export const qualFilingCommitmentSaveOrUpdate = declareRequest(
|
||||||
const res = await apiPost("/safetyEval/qual-filing-personnel/batch-add-from-org", {
|
"qualFilingLoading",
|
||||||
filingId: asId(filingId),
|
"Post > @/safetyEval/qual-filing-commitment/save-or-update",
|
||||||
sourcePersonnelIds: (sourcePersonnelIds || []).map(asId),
|
);
|
||||||
});
|
|
||||||
return res;
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingPersonnelDelete = declareRequest("qualFilingLoading", safeAction(async ({ id }) => {
|
export const qualFilingCommitmentUploadSignature = declareRequest(
|
||||||
return apiPostDelete("/safetyEval/qual-filing-personnel/delete", id);
|
"qualFilingLoading",
|
||||||
}));
|
"Post > @/safetyEval/qual-filing-commitment/upload-signature",
|
||||||
|
);
|
||||||
|
|
||||||
export const qualFilingEquipmentBatchAdd = declareRequest("qualFilingLoading", safeAction(async ({ filingId, sourceEquipmentIds }) => {
|
export const qualFilingPersonnelBatchAdd = declareRequest(
|
||||||
const res = await apiPost("/safetyEval/qual-filing-equipment/batch-add-from-org", {
|
"qualFilingLoading",
|
||||||
filingId: asId(filingId),
|
"Post > @/safetyEval/qual-filing-personnel/batch-add-from-org",
|
||||||
sourceEquipmentIds: (sourceEquipmentIds || []).map(asId),
|
);
|
||||||
});
|
|
||||||
return res;
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingEquipmentUploadCalibration = declareRequest("qualFilingLoading", safeAction(async ({ id, attachmentUrl, files }) => {
|
export const qualFilingPersonnelDelete = declareRequest(
|
||||||
const url = attachmentUrl || resolveUploadFileId(files);
|
"qualFilingLoading",
|
||||||
const res = await apiPost("/safetyEval/qual-filing-equipment/upload-calibration", { id: asId(id), attachmentUrl: url });
|
"Post > @/safetyEval/qual-filing-personnel/delete",
|
||||||
return fromSingleResponse(res);
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
export const qualFilingEquipmentDelete = declareRequest("qualFilingLoading", safeAction(async ({ id }) => {
|
export const qualFilingEquipmentBatchAdd = declareRequest(
|
||||||
return apiPostDelete("/safetyEval/qual-filing-equipment/delete", id);
|
"qualFilingLoading",
|
||||||
}));
|
"Post > @/safetyEval/qual-filing-equipment/batch-add-from-org",
|
||||||
|
);
|
||||||
|
|
||||||
|
export const qualFilingEquipmentUploadCalibration = declareRequest(
|
||||||
|
"qualFilingLoading",
|
||||||
|
"Post > @/safetyEval/qual-filing-equipment/upload-calibration",
|
||||||
|
);
|
||||||
|
|
||||||
|
export const qualFilingEquipmentDelete = declareRequest(
|
||||||
|
"qualFilingLoading",
|
||||||
|
"Post > @/safetyEval/qual-filing-equipment/delete",
|
||||||
|
);
|
||||||
|
|
||||||
export const qualFilingChangeSubmit = declareRequest("qualFilingLoading", safeAction(async ({ draftFilingId }) => {
|
export const qualFilingChangeSubmit = declareRequest(
|
||||||
return apiPost("/safetyEval/qual-filing-change/submit", { draftFilingId: asId(draftFilingId) });
|
"qualFilingLoading",
|
||||||
}));
|
"Post > @/safetyEval/qual-filing-change/submit",
|
||||||
|
);
|
||||||
|
|
||||||
export const qualFilingReviewGet = declareRequest(
|
export const qualFilingReviewGet = declareRequest(
|
||||||
"qualFilingLoading",
|
"qualFilingLoading",
|
||||||
|
|
@ -348,4 +125,3 @@ export const submitQualFilingChange = declareRequest(
|
||||||
"qualFilingSubmitLoading",
|
"qualFilingSubmitLoading",
|
||||||
"Post > @/safetyEval/qual-filing-change/aggregationSaveOrEdit",
|
"Post > @/safetyEval/qual-filing-change/aggregationSaveOrEdit",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ export const FILED_STATUS_OPTIONS = [
|
||||||
/** 备案变更管理列表筛选项 */
|
/** 备案变更管理列表筛选项 */
|
||||||
export const CHANGE_STATUS_OPTIONS = [
|
export const CHANGE_STATUS_OPTIONS = [
|
||||||
{ label: "全部", value: "" },
|
{ label: "全部", value: "" },
|
||||||
|
{ label: "已打回", value: "3" },
|
||||||
{ label: "已备案", value: "1" },
|
{ label: "已备案", value: "1" },
|
||||||
{ label: "变更审核中", value: "4" },
|
{ label: "变更审核中", value: "4" },
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||||
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
||||||
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
||||||
import FilingListTable from "../../FilingListTable";
|
import FilingListTable from "../../FilingListTable";
|
||||||
import { goFilingForm } from "../../filingPaths";
|
|
||||||
|
|
||||||
const { router } = tools;
|
const { router } = tools;
|
||||||
|
|
||||||
|
|
@ -56,7 +55,7 @@ function FiledManageListPage(props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
goFilingForm({ mode: FILING_FORM_MODE.FILED });
|
props.history.push(`/container/qualApplication/filingForm?mode=${FILING_FORM_MODE.FILED}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [reviewModalOpen, setReviewModalOpen] = useState(false);
|
const [reviewModalOpen, setReviewModalOpen] = useState(false);
|
||||||
|
|
@ -98,6 +97,7 @@ function FiledManageListPage(props) {
|
||||||
total={total}
|
total={total}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scrollY={props.scrollY}
|
scrollY={props.scrollY}
|
||||||
|
history={props.history}
|
||||||
searchForm={searchForm}
|
searchForm={searchForm}
|
||||||
onSearch={handleSearch}
|
onSearch={handleSearch}
|
||||||
onPageChange={handlePageChange}
|
onPageChange={handlePageChange}
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ function FilingApplicationListPage(props) {
|
||||||
total={total}
|
total={total}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scrollY={props.scrollY}
|
scrollY={props.scrollY}
|
||||||
|
history={props.history}
|
||||||
searchForm={searchForm}
|
searchForm={searchForm}
|
||||||
onSearch={handleSearch}
|
onSearch={handleSearch}
|
||||||
onPageChange={handlePageChange}
|
onPageChange={handlePageChange}
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@ function FilingChangeListPage(props) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleSearch = (values) => {
|
const handleSearch = (values) => {
|
||||||
const { filingNo, ...rest } = values;
|
|
||||||
const { filingNo: _omit, ...restQuery } = router.query;
|
router.query = { ...values, current: 1, size: 10 };
|
||||||
router.query = { ...restQuery, ...rest, ...(filingNo != null && filingNo !== "" ? { id: filingNo } : {}), current: 1, size: 10 };
|
|
||||||
getData();
|
getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -86,6 +85,7 @@ function FilingChangeListPage(props) {
|
||||||
total={total}
|
total={total}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
scrollY={props.scrollY}
|
scrollY={props.scrollY}
|
||||||
|
history={props.history}
|
||||||
searchForm={searchForm}
|
searchForm={searchForm}
|
||||||
onSearch={handleSearch}
|
onSearch={handleSearch}
|
||||||
onPageChange={handlePageChange}
|
onPageChange={handlePageChange}
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,12 @@ export default function ChangeHistoryModal({ open, filingId, onCancel }) {
|
||||||
<Table
|
<Table
|
||||||
size="small"
|
size="small"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
rowKey={(row) => row.id || row.index}
|
rowKey="id"
|
||||||
pagination={false}
|
pagination={false}
|
||||||
dataSource={records}
|
dataSource={records}
|
||||||
locale={{ emptyText: changeCount ? "暂无明细" : "暂无变更记录" }}
|
locale={{ emptyText: changeCount ? "暂无明细" : "暂无变更记录" }}
|
||||||
columns={[
|
columns={[
|
||||||
{ title: "序号", dataIndex: "index", width: 60 },
|
{ title: "序号", width: 60, render: (_, __, index) => index + 1 },
|
||||||
{ title: "变更事项", dataIndex: "changeItemName" },
|
{ title: "变更事项", dataIndex: "changeItemName" },
|
||||||
{ title: "变更时间", dataIndex: "changeTime", width: 120 },
|
{ title: "变更时间", dataIndex: "changeTime", width: 120 },
|
||||||
{ title: "操作人", dataIndex: "operatorName", width: 100, render: (val) => val || "-" },
|
{ title: "操作人", dataIndex: "operatorName", width: 100, render: (val) => val || "-" },
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd";
|
import { Button, Form, message, Modal, Space, Spin, Tabs } from "antd";
|
||||||
|
import dayjs from "dayjs";
|
||||||
import { useCallback, useEffect, useRef, useState } from "react";
|
import { useCallback, useEffect, useRef, useState } from "react";
|
||||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||||
import { fetchQualFilingDetail, fetchQualChangeDetail, } from "~/api/qualFiling";
|
import { fetchQualFilingDetail, fetchQualChangeDetail } from "~/api/qualFiling";
|
||||||
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
||||||
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
||||||
import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate";
|
import { FILING_MATERIAL_TEMPLATE } from "../filingMaterialTemplate";
|
||||||
|
|
@ -79,9 +80,12 @@ function FilingFormPage(props) {
|
||||||
}
|
}
|
||||||
aciotn(query.id).then((res) => {
|
aciotn(query.id).then((res) => {
|
||||||
setDetail((prev) => ({ ...prev, ...(res?.data || {}) }));
|
setDetail((prev) => ({ ...prev, ...(res?.data || {}) }));
|
||||||
console.log(res?.data, "res.data");
|
|
||||||
basicForm.setFieldsValue(res?.data || {});
|
basicForm.setFieldsValue(res?.data || {});
|
||||||
commitmentForm.setFieldsValue(res?.data?.commitment || {});
|
const commitment = res?.data?.commitment || {};
|
||||||
|
commitmentForm.setFieldsValue({
|
||||||
|
...commitment,
|
||||||
|
signDate: commitment.signDate ? dayjs(commitment.signDate) : undefined,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setDetail((prev) => ({ ...prev, materials: FILING_MATERIAL_TEMPLATE }));
|
setDetail((prev) => ({ ...prev, materials: FILING_MATERIAL_TEMPLATE }));
|
||||||
|
|
@ -176,7 +180,7 @@ function FilingFormPage(props) {
|
||||||
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(item=>{
|
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList.map(item=>{
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
personName: item.userName,
|
personName: item.userName || item.personName,
|
||||||
sourcePersonnelId: item.id,
|
sourcePersonnelId: item.id,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ import { CHONGQING_DISTRICTS } from "~/enumerate/enterpriseOptions";
|
||||||
import {
|
import {
|
||||||
FILING_FORM_MODE,
|
FILING_FORM_MODE,
|
||||||
getFilingStatusOptions,
|
getFilingStatusOptions,
|
||||||
|
|
||||||
isQualFilingEditable,
|
isQualFilingEditable,
|
||||||
QUAL_FILING_STATUS_COLOR,
|
QUAL_FILING_STATUS_COLOR,
|
||||||
} from "~/enumerate/qualFilingOptions";
|
} from "~/enumerate/qualFilingOptions";
|
||||||
import { CHANGE_COUNT_STYLE, getChangeCount } from "~/utils/enterpriseForm";
|
import { CHANGE_COUNT_STYLE, getChangeCount } from "~/utils/enterpriseForm";
|
||||||
import { goFilingForm } from "./filingPaths";
|
|
||||||
|
|
||||||
export default function FilingListTable({
|
export default function FilingListTable({
|
||||||
dataSource,
|
dataSource,
|
||||||
|
|
@ -30,18 +30,21 @@ export default function FilingListTable({
|
||||||
PageLayout,
|
PageLayout,
|
||||||
onDelete,
|
onDelete,
|
||||||
extraActions,
|
extraActions,
|
||||||
|
history,
|
||||||
}) {
|
}) {
|
||||||
const statusOptions = getFilingStatusOptions(mode);
|
const statusOptions = getFilingStatusOptions(mode);
|
||||||
|
|
||||||
const canEditRow = (record) => {
|
const canEditRow = (record) => {
|
||||||
|
if (mode === FILING_FORM_MODE.FILED) {
|
||||||
|
return record.filingStatusCode === 2;
|
||||||
|
}
|
||||||
return isQualFilingEditable(record.filingStatusCode);
|
return isQualFilingEditable(record.filingStatusCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: "备案属地", dataIndex: "filingTerritoryName", width: 120, ellipsis: true },
|
{ title: "备案属地", dataIndex: "filingTerritoryName", width: 120, ellipsis: true },
|
||||||
{ title: "备案单位", dataIndex: "filingUnitName", ellipsis: true },
|
{ title: "备案单位", dataIndex: "filingUnitName", ellipsis: true },
|
||||||
{ title: "备案编号", dataIndex: "filingNo", width: 200, render: (val, record) => val || record.id || "-" },
|
{ title: "备案编号", dataIndex: "filingNo", width: 200},
|
||||||
{ title: "安全评价业务范围", dataIndex: "businessScope", ellipsis: true },
|
{ title: "安全评价业务范围", dataIndex: "businessScope", ellipsis: true },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -93,7 +96,7 @@ export default function FilingListTable({
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => goFilingForm({ mode, id: record.id, readOnly: true })}
|
onClick={() => history.push(`/container/qualApplication/filingForm?mode=${mode}&id=${record.id}&readOnly=1`)}
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -102,7 +105,7 @@ export default function FilingListTable({
|
||||||
<Button
|
<Button
|
||||||
type="link"
|
type="link"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => goFilingForm({ mode, id: record.id })}
|
onClick={() => history.push(`/container/qualApplication/filingForm?mode=${mode}&id=${record.id}`)}
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -138,7 +141,7 @@ export default function FilingListTable({
|
||||||
<Form.Item key="filingUnitName" name="filingUnitName">
|
<Form.Item key="filingUnitName" name="filingUnitName">
|
||||||
<ControlWrapper.Input label="备案单位" placeholder="关键字搜索" allowClear />
|
<ControlWrapper.Input label="备案单位" placeholder="关键字搜索" allowClear />
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="filingTerritoryName" name="filingTerritoryName">
|
<Form.Item key="filingTerritoryCode" name="filingTerritoryCode">
|
||||||
<ControlWrapper.Select
|
<ControlWrapper.Select
|
||||||
label="备案属地"
|
label="备案属地"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
|
|
@ -150,14 +153,15 @@ export default function FilingListTable({
|
||||||
))}
|
))}
|
||||||
</ControlWrapper.Select>
|
</ControlWrapper.Select>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="filingNo" name="filingNo" normalize={(v) => (v ? v.replace(/\D/g, "").slice(0, 20) : v)}>
|
<Form.Item key="filingNo" name="filingNo">
|
||||||
<ControlWrapper.Input label="备案编号" placeholder="请输入" allowClear maxLength={20} />
|
<ControlWrapper.Input label="备案编号" placeholder="关键字搜索" allowClear />
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="filingStatus" name="filingStatus">
|
<Form.Item key="filingStatusCode" name="filingStatusCode">
|
||||||
<ControlWrapper.Select
|
<ControlWrapper.Select
|
||||||
label="备案状态"
|
label="备案状态"
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
|
|
||||||
|
showSearch={false}
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
{statusOptions.map((opt) => (
|
{statusOptions.map((opt) => (
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,7 @@ export const FILING_LIST_PATH = {
|
||||||
change: "/safetyEval/container/qualApplication/filingChange/list",
|
change: "/safetyEval/container/qualApplication/filingChange/list",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function goFilingForm({ mode, id, originFilingId, readOnly }) {
|
|
||||||
const params = new URLSearchParams({ mode });
|
|
||||||
if (id) {
|
|
||||||
params.set("id", String(id));
|
|
||||||
}
|
|
||||||
if (originFilingId) {
|
|
||||||
params.set("originFilingId", String(originFilingId));
|
|
||||||
}
|
|
||||||
if (readOnly) {
|
|
||||||
params.set("readOnly", "1");
|
|
||||||
}
|
|
||||||
window.location.href = `${FILING_FORM_PATH}?${params.toString()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function goFilingList(mode) {
|
export function goFilingList(mode) {
|
||||||
window.location.href = FILING_LIST_PATH[mode] || FILING_LIST_PATH.application;
|
window.location.href = FILING_LIST_PATH[mode] || FILING_LIST_PATH.application;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue