Merge branch 'dev' of http://47.92.113.182:3000/cq_anquan/safety-eval-service-frontend into dev
commit
f279702782
|
|
@ -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, {});
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
@ -55,9 +55,9 @@ function DepartmentPositionPage(props) {
|
||||||
try {
|
try {
|
||||||
const res = await props.staffInfoList?.({ pageIndex: 1, pageSize: 500 });
|
const res = await props.staffInfoList?.({ pageIndex: 1, pageSize: 500 });
|
||||||
setStaffOptions((res?.data || []).map((s) => ({
|
setStaffOptions((res?.data || []).map((s) => ({
|
||||||
label: `${s.staffName}(${s.account})`,
|
label: `${s.userName ?? s.staffName}(${s.account})`,
|
||||||
value: s.account,
|
value: s.account,
|
||||||
staffName: s.staffName,
|
staffName: s.userName ?? s.staffName,
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
||||||
|
|
@ -183,8 +183,8 @@ function PersonnelChangePage(props) {
|
||||||
width: 140,
|
width: 140,
|
||||||
render: (_, record) => {
|
render: (_, record) => {
|
||||||
const code = record.resignAuditStatus ?? record.auditStatus ?? record.auditStatusCode;
|
const code = record.resignAuditStatus ?? record.auditStatus ?? record.auditStatusCode;
|
||||||
return RESIGN_AUDIT_STATUS_LABEL[code] ? <Tag color={AUDIT_STATUS_COLOR[code]}>{label}</Tag> : "-";
|
const label = RESIGN_AUDIT_STATUS_LABEL[code];
|
||||||
|
return label ? <Tag color={AUDIT_STATUS_COLOR[code]}>{label}</Tag> : "-";
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,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) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import {
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
import AttachmentUpload from "~/components/AttachmentUpload";
|
||||||
import { UploadOutlined } from "@ant-design/icons";
|
|
||||||
import PreviewUrlButton from "~/components/PreviewUrlButton";
|
import PreviewUrlButton from "~/components/PreviewUrlButton";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||||
|
|
@ -222,6 +221,12 @@ function AddModal({ open, staffOptions, requestAdd, onCancel, onSuccess }) {
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
const values = await form.validateFields();
|
const values = await form.validateFields();
|
||||||
|
if (!values.reportFileUrl?.length) {
|
||||||
|
form.setFields([
|
||||||
|
{ name: "reportFileUrl", errors: ["请上传离职通知报告"] },
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setSubmitting(true);
|
setSubmitting(true);
|
||||||
values.applyTime =
|
values.applyTime =
|
||||||
values.applyTime?.format?.("YYYY-MM-DD HH:mm:ss") || values.applyTime;
|
values.applyTime?.format?.("YYYY-MM-DD HH:mm:ss") || values.applyTime;
|
||||||
|
|
@ -292,52 +297,12 @@ function AddModal({ open, staffOptions, requestAdd, onCancel, onSuccess }) {
|
||||||
<Form.Item name="remark" label="备注">
|
<Form.Item name="remark" label="备注">
|
||||||
<Input.TextArea rows={2} placeholder="请输入备注" />
|
<Input.TextArea rows={2} placeholder="请输入备注" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<AttachmentUpload name="reportFileUrl" label="离职通知报告" maxCount={1} accept=".pdf" />
|
<AttachmentUpload
|
||||||
<Form.Item
|
|
||||||
name="reportFileUrl"
|
name="reportFileUrl"
|
||||||
label="离职通知报告"
|
label="离职通知报告"
|
||||||
rules={[{ required: true, message: "请上传离职通知报告" }]}
|
|
||||||
>
|
|
||||||
<Upload
|
|
||||||
action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`}
|
|
||||||
maxCount={1}
|
maxCount={1}
|
||||||
accept=".pdf"
|
accept=".pdf"
|
||||||
showUploadList={{
|
/>
|
||||||
showPreviewIcon: true,
|
|
||||||
showRemoveIcon: true,
|
|
||||||
showDownloadIcon: false,
|
|
||||||
}}
|
|
||||||
onPreview={() => {
|
|
||||||
const url = form.getFieldValue("reportFileUrl");
|
|
||||||
if (url) window.open(url);
|
|
||||||
}}
|
|
||||||
onChange={(info) => {
|
|
||||||
if (info.file.status === "uploading") {
|
|
||||||
setUploading(true);
|
|
||||||
} else {
|
|
||||||
setUploading(false);
|
|
||||||
if (info.file.status === "done") {
|
|
||||||
const data = info.file.response?.data;
|
|
||||||
if (data) {
|
|
||||||
const url = data.url || data;
|
|
||||||
form.setFieldsValue({ reportFileUrl: url });
|
|
||||||
} else {
|
|
||||||
message.error("上传失败,未获取到文件地址");
|
|
||||||
}
|
|
||||||
} else if (info.file.status === "error") {
|
|
||||||
message.error(`${info.file.name} 上传失败`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onRemove={() => {
|
|
||||||
form.setFieldsValue({ reportFileUrl: "" });
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Button loading={uploading} icon={<UploadOutlined />}>
|
|
||||||
上传文件
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</Form.Item>
|
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue