修护,人员重置密码、删除等提示错误

dev_1.0.1
huwei 2026-07-07 16:30:26 +08:00
parent 7121437b4d
commit 412b8479c0
3 changed files with 12 additions and 58 deletions

View File

@ -1,5 +1,6 @@
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
import { apiPost, apiPostDelete, safeAction } from "../enterpriseInfo/http";
import { apiPost, safeAction } from "../enterpriseInfo/http";
import { asId } from "../enterpriseInfo/idUtil";
export const staffInfoList = declareRequest(
"staffInfoLoading",
@ -25,13 +26,10 @@ export const staffInfoEdit = declareRequest(
export const staffInfoRemove = declareRequest(
"staffInfoLoading",
safeAction(async ({ id }) => apiPostDelete("/safetyEval/org-personnel/delete", id)),
safeAction(async ({ id }) => apiPost("/safetyEval/org-personnel/delete", { data: asId(id) })),
);
export const staffInfoResetPassword = declareRequest(
"staffInfoLoading",
safeAction(async ({ id }) => {
const url = `/safetyEval/org-personnel/reset-password?id=${encodeURIComponent(id)}`;
return apiPost(url, {});
}),
safeAction(async ({ id }) => apiPost("/safetyEval/org-personnel/reset-password", { data: asId(id) })),
);

View File

@ -1,6 +1,5 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, DatePicker, Form, Image, Input, message, Modal, Row, Col, Select, Table, Upload } from "antd";
import { UploadOutlined } from "@ant-design/icons";
import { Button, DatePicker, Form, Input, message, Modal, Row, Col, Select, Table } from "antd";
import { useEffect, useRef, useState } from "react";
import dayjs from "dayjs";
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
@ -319,14 +318,10 @@ function StaffFormModal({
const [detailLoading, setDetailLoading] = useState(false);
const [deptPositionOptions, setDeptPositionOptions] = useState([]);
const [positionLoading, setPositionLoading] = useState(false);
const [uploadFileList, setUploadFileList] = useState([]);
const [previewImage, setPreviewImage] = useState("");
const watchedDeptId = Form.useWatch("deptId", form);
const wasOpenRef = useRef(false);
const inflightDeptRef = useRef(null);
const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || "");
const loadPositionsByDept = async (deptId) => {
const id = deptId;
if (!id) {
@ -363,8 +358,6 @@ function StaffFormModal({
if (!currentId) {
form.resetFields();
setDeptPositionOptions([]);
setUploadFileList([]);
setPreviewImage("");
form.setFieldsValue({
registerEngineerFlag: 2,
});
@ -372,8 +365,6 @@ function StaffFormModal({
}
if (!open) {
setDeptPositionOptions([]);
setUploadFileList([]);
setPreviewImage("");
}
wasOpenRef.current = open;
}, [open, currentId, form]);
@ -410,8 +401,6 @@ function StaffFormModal({
const handleCancel = () => {
form.resetFields();
setDeptPositionOptions([]);
setUploadFileList([]);
setPreviewImage("");
onCancel();
};
@ -661,46 +650,6 @@ function StaffFormModal({
label="申报专业能力证明材料"
maxCount={5}
/>
<Form.Item
name="proofMaterialUrl"
label="申报专业能力证明材料"
valuePropName="fileList"
getValueFromEvent={(e) => {
if (Array.isArray(e)) return e;
return e?.fileList;
}}
>
<Upload
action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`}
headers={{ token: sessionStorage.getItem("token") }}
maxCount={5}
fileList={uploadFileList}
onChange={(info) => {
setUploadFileList(info.fileList);
}}
onPreview={(file) => {
const src = file.url || file.response?.data?.url || file.thumbUrl;
if (!src) return;
if (isImage(src)) {
setPreviewImage(src);
} else {
window.open(src, "_blank");
}
}}
>
<Button icon={<UploadOutlined />}>上传文件</Button>
</Upload>
</Form.Item>
<Image
style={{ display: "none" }}
preview={{
visible: !!previewImage,
src: previewImage,
onVisibleChange: (visible) => {
if (!visible) setPreviewImage("");
},
}}
/>
</Col>
<Col span={12}>
<Form.Item name="currentAddress" label="现住地址">

View File

@ -59,6 +59,13 @@ function QualificationCertPage(props) {
...router.query,
current: router.query.current || 1,
pageSize: router.query.pageSize || 10,
// 映射后端期望的字段名:前端 likeCertName → 后端 certName
certName: router.query.likeCertName || undefined,
// 映射日期筛选:前端 validStartDate/validEndDate → 后端 startTime/endTime (LocalDateTime 格式)
startTime: router.query.validStartDate ? `${router.query.validStartDate} 00:00:00` : undefined,
endTime: router.query.validEndDate ? `${router.query.validEndDate} 23:59:59` : undefined,
// 后端分页字段名为 size
size: router.query.pageSize || 10,
};
const res = await props.orgQualificationCertList(params);
if (res?.success !== false) {