修护,人员重置密码、删除等提示错误
parent
7121437b4d
commit
412b8479c0
|
|
@ -1,5 +1,6 @@
|
||||||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
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(
|
export const staffInfoList = declareRequest(
|
||||||
"staffInfoLoading",
|
"staffInfoLoading",
|
||||||
|
|
@ -25,13 +26,10 @@ export const staffInfoEdit = declareRequest(
|
||||||
|
|
||||||
export const staffInfoRemove = declareRequest(
|
export const staffInfoRemove = declareRequest(
|
||||||
"staffInfoLoading",
|
"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(
|
export const staffInfoResetPassword = declareRequest(
|
||||||
"staffInfoLoading",
|
"staffInfoLoading",
|
||||||
safeAction(async ({ id }) => {
|
safeAction(async ({ id }) => apiPost("/safetyEval/org-personnel/reset-password", { data: asId(id) })),
|
||||||
const url = `/safetyEval/org-personnel/reset-password?id=${encodeURIComponent(id)}`;
|
|
||||||
return apiPost(url, {});
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, DatePicker, Form, Image, Input, message, Modal, Row, Col, Select, Table, Upload } from "antd";
|
import { Button, DatePicker, Form, Input, message, Modal, Row, Col, Select, Table } from "antd";
|
||||||
import { UploadOutlined } from "@ant-design/icons";
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||||
|
|
@ -319,14 +318,10 @@ function StaffFormModal({
|
||||||
const [detailLoading, setDetailLoading] = useState(false);
|
const [detailLoading, setDetailLoading] = useState(false);
|
||||||
const [deptPositionOptions, setDeptPositionOptions] = useState([]);
|
const [deptPositionOptions, setDeptPositionOptions] = useState([]);
|
||||||
const [positionLoading, setPositionLoading] = useState(false);
|
const [positionLoading, setPositionLoading] = useState(false);
|
||||||
const [uploadFileList, setUploadFileList] = useState([]);
|
|
||||||
const [previewImage, setPreviewImage] = useState("");
|
|
||||||
const watchedDeptId = Form.useWatch("deptId", form);
|
const watchedDeptId = Form.useWatch("deptId", form);
|
||||||
const wasOpenRef = useRef(false);
|
const wasOpenRef = useRef(false);
|
||||||
const inflightDeptRef = useRef(null);
|
const inflightDeptRef = useRef(null);
|
||||||
|
|
||||||
const isImage = (url) => /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(url || "");
|
|
||||||
|
|
||||||
const loadPositionsByDept = async (deptId) => {
|
const loadPositionsByDept = async (deptId) => {
|
||||||
const id = deptId;
|
const id = deptId;
|
||||||
if (!id) {
|
if (!id) {
|
||||||
|
|
@ -363,8 +358,6 @@ function StaffFormModal({
|
||||||
if (!currentId) {
|
if (!currentId) {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setDeptPositionOptions([]);
|
setDeptPositionOptions([]);
|
||||||
setUploadFileList([]);
|
|
||||||
setPreviewImage("");
|
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
registerEngineerFlag: 2,
|
registerEngineerFlag: 2,
|
||||||
});
|
});
|
||||||
|
|
@ -372,8 +365,6 @@ function StaffFormModal({
|
||||||
}
|
}
|
||||||
if (!open) {
|
if (!open) {
|
||||||
setDeptPositionOptions([]);
|
setDeptPositionOptions([]);
|
||||||
setUploadFileList([]);
|
|
||||||
setPreviewImage("");
|
|
||||||
}
|
}
|
||||||
wasOpenRef.current = open;
|
wasOpenRef.current = open;
|
||||||
}, [open, currentId, form]);
|
}, [open, currentId, form]);
|
||||||
|
|
@ -410,8 +401,6 @@ function StaffFormModal({
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setDeptPositionOptions([]);
|
setDeptPositionOptions([]);
|
||||||
setUploadFileList([]);
|
|
||||||
setPreviewImage("");
|
|
||||||
onCancel();
|
onCancel();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -661,46 +650,6 @@ function StaffFormModal({
|
||||||
label="申报专业能力证明材料"
|
label="申报专业能力证明材料"
|
||||||
maxCount={5}
|
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>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item name="currentAddress" label="现住地址">
|
<Form.Item name="currentAddress" label="现住地址">
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,13 @@ function QualificationCertPage(props) {
|
||||||
...router.query,
|
...router.query,
|
||||||
current: router.query.current || 1,
|
current: router.query.current || 1,
|
||||||
pageSize: router.query.pageSize || 10,
|
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);
|
const res = await props.orgQualificationCertList(params);
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue