fix(inspection): 修复检查时间格式和计划执行相关功能
- 修复检查时间查询时添加了正确的开始和结束时间格式 (00:00:00 和 23:59:59) - 修复检查时间显示时添加了空值判断,避免显示异常 - 修复检查人员显示时添加了联系电话信息 - 移除了检查视图页面的打印按钮 - 修复计划执行详情页面跳转时传递了正确的类型参数 - 修复计划管理页面的查询参数传递和格式化问题 - 优化了计划执行记录页面的部门选择器配置 - 修复了计划状态判断逻辑和相关显示问题 - 添加了计划管理页面的权限控制参数传递master
parent
d21c39108f
commit
e91eabcd55
|
|
@ -9,8 +9,8 @@ module.exports = {
|
|||
// 应用后端分支名称,部署上线需要
|
||||
javaGitBranch: "<branch-name>",
|
||||
// 接口服务地址
|
||||
// API_HOST: "http://192.168.20.100:30140",
|
||||
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
API_HOST: "http://192.168.20.100:30140",
|
||||
// API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
},
|
||||
production: {
|
||||
// 应用后端分支名称,部署上线需要
|
||||
|
|
@ -25,8 +25,8 @@ module.exports = {
|
|||
contextInject: {
|
||||
// 应用Key
|
||||
appKey: "",
|
||||
// fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
},
|
||||
// public/index.html注入全局变量
|
||||
windowInject: {
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "400" },
|
||||
});
|
||||
|
|
@ -51,7 +51,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{ title: "检查状态", dataIndex: "status", render: () => "待验收" },
|
||||
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "301" },
|
||||
});
|
||||
|
|
@ -51,7 +51,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{ title: "检查状态", dataIndex: "status", render: () => "待指派" },
|
||||
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "700" },
|
||||
});
|
||||
|
|
@ -64,7 +64,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{ title: "检查状态", dataIndex: "status", render: () => "被检查单位负责人申辩" },
|
||||
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
|
||||
{
|
||||
|
|
@ -263,27 +263,31 @@ function DefenseRecordModalComponent(props) {
|
|||
columns={[
|
||||
{ title: "申辩时间", dataIndex: "createTime", width: 200 },
|
||||
{ title: "申辩描述", dataIndex: "content" },
|
||||
{ title: "申辩状态", dataIndex: "isPass", render: (_, record) => (
|
||||
<>
|
||||
<div>{record.isPass === 0 && "未审批"}</div>
|
||||
<div>{record.isPass === 1 && "通过"}</div>
|
||||
<div>{record.isPass === 2 && "未通过"}</div>
|
||||
</>
|
||||
) },
|
||||
{
|
||||
title: "申辩状态", dataIndex: "isPass", render: (_, record) => (
|
||||
<>
|
||||
<div>{record.isPass === 0 && "未审批"}</div>
|
||||
<div>{record.isPass === 1 && "通过"}</div>
|
||||
<div>{record.isPass === 2 && "未通过"}</div>
|
||||
</>
|
||||
)
|
||||
},
|
||||
{ title: "签字图片", dataIndex: "signature", render: (_, record) => (record.signature && <Image src={getFileUrl() + record.signature} width={100} height={100} />) },
|
||||
{ title: "申辩附件名称", dataIndex: "name", width: 200, render: (_, record) => record.files?.[0]?.fileName || "无" },
|
||||
{ title: "申辩附件", dataIndex: "url", render: (_, record) => (
|
||||
record.files?.[0]?.filePath && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
downloadFile({ url: record.files?.[0]?.filePath, name: record.files?.[0]?.fileName || "无" });
|
||||
}}
|
||||
>
|
||||
下载
|
||||
</Button>
|
||||
{
|
||||
title: "申辩附件", dataIndex: "url", render: (_, record) => (
|
||||
record.files?.[0]?.filePath && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
downloadFile({ url: record.files?.[0]?.filePath, name: record.files?.[0]?.fileName || "无" });
|
||||
}}
|
||||
>
|
||||
下载
|
||||
</Button>
|
||||
)
|
||||
)
|
||||
) },
|
||||
},
|
||||
{ title: "检查人签字", dataIndex: "checkSign", render: (_, record) => (record.checkSign && <Image src={getFileUrl() + record.checkSign} width={100} height={100} />) },
|
||||
{ title: "检查人意见", dataIndex: "checkRemarks" },
|
||||
{ title: "审批时间", dataIndex: "checkSignTime", width: 200 },
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "300" },
|
||||
});
|
||||
|
|
@ -60,7 +60,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{ title: "检查状态", dataIndex: "status", render: () => "待确认" },
|
||||
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
|
||||
{
|
||||
|
|
@ -158,7 +158,7 @@ function ConfirmModalComponent(props) {
|
|||
label: "是否申辩",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ bianma: "2", name: "是" }, { bianma: "1", name: "否" }],
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
disabled: props.hiddenNumber === 0,
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -320,6 +320,8 @@ function Add(props) {
|
|||
values={{
|
||||
planType: query.planId ? 1 : 0,
|
||||
planId: query.planId,
|
||||
type:query.type,
|
||||
typeName:query.typeName,
|
||||
situationList: [{ content: undefined }],
|
||||
}}
|
||||
loading={deleteFileLoading || getFileLoading || uploadFileLoading || props.inspection.inspectionLoading}
|
||||
|
|
@ -399,6 +401,7 @@ function Add(props) {
|
|||
dictValue="inspectionType"
|
||||
onlyLastLevel
|
||||
onGetLabel={label => form.setFieldValue("typeName", label)}
|
||||
disabled={!!query.planId}
|
||||
/>
|
||||
),
|
||||
formItemProps: { labelCol: { span: 6 } },
|
||||
|
|
@ -433,6 +436,7 @@ function Add(props) {
|
|||
label: "检查人员部门",
|
||||
render: (
|
||||
<DepartmentSelectTree
|
||||
searchType={props.searchType}
|
||||
onChange={() => {
|
||||
form.setFieldValue(["inspectorList", field.name, "userId"], "");
|
||||
form.setFieldValue(["inspectorList", field.name, "userName"], "");
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "", planId: query.planId, entrance: query.planId ? "2" : "1", planType: query.planId ? 1 : 0 },
|
||||
});
|
||||
|
|
@ -63,7 +63,7 @@ function List(props) {
|
|||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push(`./add?planId=${query.planId || ""}`);
|
||||
props.history.push(`./add?planId=${query.planId || ""}&type=${query.type || ""}&typeName=${query.typeName || ""}`);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: { status: "200" },
|
||||
});
|
||||
|
|
@ -58,7 +58,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{ title: "检查状态", dataIndex: "status", render: () => "待核实" },
|
||||
{ title: "发现隐患数", dataIndex: "hiddenNumber" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ function List(props) {
|
|||
const { tableProps, getData } = useTable(props["inspectionList"], {
|
||||
form,
|
||||
transform: formData => ({
|
||||
checkStartTime: formData.checkTime?.[0],
|
||||
checkEndTime: formData.checkTime?.[1],
|
||||
checkStartTime: formData.checkTime?.[0] ? (formData.checkTime[0] + " 00:00:00") : "",
|
||||
checkEndTime: formData.checkTime?.[1] ? (formData.checkTime[1] + " 23:59:59") : "",
|
||||
}),
|
||||
params: {
|
||||
status: "",
|
||||
|
|
@ -169,7 +169,7 @@ function List(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{
|
||||
title: "检查状态",
|
||||
dataIndex: "status",
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ function InspectionView(props) {
|
|||
}
|
||||
}
|
||||
data.inspectorVerificationList.forEach((item) => {
|
||||
setCurrentInspectorUserName(prev => [...prev, item.userName || ""]);
|
||||
setCurrentInspectorUserName(prev => [...prev, `${item.userName}(${item.phone})` || ""]);
|
||||
});
|
||||
setInfo(data);
|
||||
const { data: hiddenList } = await props["hiddenList"]({ foreignKey: query.inspectionId, pageIndex: 1, pageSize: 999 });
|
||||
|
|
@ -72,7 +72,7 @@ function InspectionView(props) {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<Page headerTitle="查看" extraActionButtons={<Button type="primary" onClick={handlePrint}>打印</Button>}>
|
||||
<Page headerTitle="查看">
|
||||
<Spin spinning={props.inspection.inspectionLoading || getFileLoading}>
|
||||
<div ref={contentRef}>
|
||||
<Divider orientation="left">
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./inspection/list?planId=${record.id}`);
|
||||
props.history.push(`./inspection/list?planId=${record.id}&type=${record.planType}&typeName=${record.planTypeName}`);
|
||||
}}
|
||||
>
|
||||
发起检查
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import {Permission} from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import {Connect} from "@cqsjjb/jjb-dva-runtime";
|
||||
import {Button, Form, message, Modal, Space} from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import { useEffect, useState } from "react";
|
||||
import {useEffect, useState} from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
|
|
@ -10,25 +10,25 @@ import Search from "zy-react-library/components/Search";
|
|||
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||
import DictionarySelectTree from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import {FORM_ITEM_RENDER_ENUM} from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName, validatorEndTime } from "zy-react-library/utils";
|
||||
import { NS_PLAN } from "~/enumerate/namespace";
|
||||
import {getLabelName, validatorEndTime} from "zy-react-library/utils";
|
||||
import {NS_PLAN} from "~/enumerate/namespace";
|
||||
import ViewInfo from "~/pages/Container/BranchCompany/Plan/ViewInfo";
|
||||
|
||||
function List(props) {
|
||||
const query = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["planList"], {
|
||||
const defaultParams = {};
|
||||
if (query.corpId) defaultParams.corpId = query.corpId;
|
||||
if (query.startTime) defaultParams.startTime = query.startTime;
|
||||
if (query.endTime) defaultParams.endTime = query.endTime;
|
||||
if (query.completedOnly) defaultParams.completedOnly = query.completedOnly;
|
||||
const {tableProps, getData} = useTable(props["planList"], {
|
||||
form,
|
||||
params: {
|
||||
corpId: query.corpId,
|
||||
startTime: query.startTime,
|
||||
endTime: query.endTime,
|
||||
completedOnly: query.completedOnly,
|
||||
},
|
||||
params: {...defaultParams},
|
||||
});
|
||||
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
|
|
@ -40,7 +40,7 @@ function List(props) {
|
|||
title: "删除确认",
|
||||
content: "确定要删除吗?",
|
||||
onOk: async () => {
|
||||
const { success } = await props["planDelete"]({ id });
|
||||
const {success} = await props["planDelete"]({id});
|
||||
if (success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
|
|
@ -56,11 +56,11 @@ function List(props) {
|
|||
{
|
||||
name: "planType",
|
||||
label: "计划类型",
|
||||
render: (<DictionarySelectTree dictValue="inspectionType" onlyLastLevel />),
|
||||
render: (<DictionarySelectTree dictValue="inspectionType" onlyLastLevel/>),
|
||||
},
|
||||
{ name: "planName", label: "计划名称" },
|
||||
{ name: "startTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "endTime", label: "计划结束时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{name: "planName", label: "计划名称"},
|
||||
{name: "startTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE},
|
||||
{name: "endTime", label: "计划结束时间", render: FORM_ITEM_RENDER_ENUM.DATE},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -71,7 +71,7 @@ function List(props) {
|
|||
{(props.permission(props.addPermissionKey || "inspection-qy-plan-list-add") && query.entrance !== "statistics") && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
icon={<AddIcon/>}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId("");
|
||||
|
|
@ -83,10 +83,10 @@ function List(props) {
|
|||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "计划名称", dataIndex: "planName" },
|
||||
{ title: "计划类型", dataIndex: "planTypeName" },
|
||||
{ title: "计划开始时间", dataIndex: "planStartTime" },
|
||||
{ title: "计划结束时间", dataIndex: "planEndTime" },
|
||||
{title: "计划名称", dataIndex: "planName"},
|
||||
{title: "计划类型", dataIndex: "planTypeName"},
|
||||
{title: "计划开始时间", dataIndex: "planStartTime"},
|
||||
{title: "计划结束时间", dataIndex: "planEndTime"},
|
||||
{
|
||||
title: "计划执行总次数",
|
||||
dataIndex: "planExecuteTotal",
|
||||
|
|
@ -108,7 +108,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./personnelExecutionRecords?planId=${record.id}`);
|
||||
props.history.push(`./personnelExecutionRecords?planId=${record.id}&corpId=${record.corpId}`);
|
||||
}}
|
||||
>
|
||||
{`${record.userExecuteNum}/${record.userExecuteTotal}`}
|
||||
|
|
@ -119,22 +119,19 @@ function List(props) {
|
|||
title: "计划状态",
|
||||
dataIndex: "status",
|
||||
render: (_, record) => {
|
||||
const { planExecuteTotal, userExecuteNum, planStartTime, planEndTime } = record;
|
||||
const {planExecuteTotal, userExecuteNum, planStartTime, planEndTime} = record;
|
||||
const currentTime = dayjs();
|
||||
|
||||
let statusText = "";
|
||||
|
||||
if (planExecuteTotal === userExecuteNum && planExecuteTotal > 0) {
|
||||
statusText = "已完成";
|
||||
}
|
||||
else if (currentTime.isBefore(planStartTime, "day")) {
|
||||
} else if (currentTime.isBefore(planStartTime, "day")) {
|
||||
statusText = "未开始";
|
||||
}
|
||||
else if ((currentTime.isAfter(planStartTime, "day") || currentTime.isSame(planStartTime, "day"))
|
||||
} else if ((currentTime.isAfter(planStartTime, "day") || currentTime.isSame(planStartTime, "day"))
|
||||
&& (currentTime.isBefore(planEndTime, "day") || currentTime.isSame(planEndTime, "day"))) {
|
||||
statusText = "执行中";
|
||||
}
|
||||
else if (currentTime.isAfter(planEndTime, "day")) {
|
||||
} else if (currentTime.isAfter(planEndTime, "day")) {
|
||||
statusText = "已过期";
|
||||
}
|
||||
|
||||
|
|
@ -223,10 +220,10 @@ const AddModalComponent = (props) => {
|
|||
const [form] = Form.useForm();
|
||||
const planStartTime = Form.useWatch("planStartTime", form);
|
||||
const corpId = Form.useWatch("corpId", form);
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const {getUserInfo} = useGetUserInfo();
|
||||
|
||||
const getCorpInfoList = async () => {
|
||||
const { data } = await props["corpInfoList"]({ pageSize: 9999, pageIndex: 1, enterpriseType: 2 });
|
||||
const {data} = await props["corpInfoList"]({pageSize: 9999, pageIndex: 1, enterpriseType: 2});
|
||||
setCorpInfoList(data);
|
||||
};
|
||||
|
||||
|
|
@ -236,7 +233,7 @@ const AddModalComponent = (props) => {
|
|||
setUserInfo(userInfo);
|
||||
}
|
||||
if (props.id) {
|
||||
const { data } = await props["planView"]({ id: props.id });
|
||||
const {data} = await props["planView"]({id: props.id});
|
||||
form.setFieldsValue({
|
||||
...data,
|
||||
userId: data.userId.split(","),
|
||||
|
|
@ -255,7 +252,7 @@ const AddModalComponent = (props) => {
|
|||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
const { success } = await props[!props.id ? "planAdd" : "planUpdate"]({
|
||||
const {success} = await props[!props.id ? "planAdd" : "planUpdate"]({
|
||||
...values,
|
||||
id: props.id,
|
||||
userId: values.userId.join(","),
|
||||
|
|
@ -286,11 +283,11 @@ const AddModalComponent = (props) => {
|
|||
loading={props.plan.planLoading}
|
||||
form={form}
|
||||
showActionButtons={false}
|
||||
labelCol={{ span: 10 }}
|
||||
labelCol={{span: 10}}
|
||||
span={24}
|
||||
onFinish={onSubmit}
|
||||
options={[
|
||||
{ name: "planName", label: "计划名称" },
|
||||
{name: "planName", label: "计划名称"},
|
||||
{
|
||||
name: "planType",
|
||||
label: "计划类型",
|
||||
|
|
@ -302,8 +299,8 @@ const AddModalComponent = (props) => {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{ name: "planTypeName", label: "计划类型", onlyForLabel: true },
|
||||
{ name: "planStartTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{name: "planTypeName", label: "计划类型", onlyForLabel: true},
|
||||
{name: "planStartTime", label: "计划开始时间", render: FORM_ITEM_RENDER_ENUM.DATE},
|
||||
{
|
||||
name: "planEndTime",
|
||||
label: "计划结束时间",
|
||||
|
|
@ -315,11 +312,16 @@ const AddModalComponent = (props) => {
|
|||
label: "计划执行单位",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: corpInfoList,
|
||||
itemsField: { labelKey: "corpName", valueKey: "id" },
|
||||
itemsField: {labelKey: "corpName", valueKey: "id"},
|
||||
hidden: !(props.supervision === "1"),
|
||||
componentProps: {
|
||||
onChange: (event) => {
|
||||
form.setFieldValue("corpName", getLabelName({ list: corpInfoList, status: event, idKey: "id", nameKey: "corpName" }));
|
||||
form.setFieldValue("corpName", getLabelName({
|
||||
list: corpInfoList,
|
||||
status: event,
|
||||
idKey: "id",
|
||||
nameKey: "corpName"
|
||||
}));
|
||||
form.setFieldValue("userId", []);
|
||||
form.setFieldValue("userName", []);
|
||||
form.setFieldValue("departmentId", []);
|
||||
|
|
@ -329,7 +331,7 @@ const AddModalComponent = (props) => {
|
|||
},
|
||||
},
|
||||
},
|
||||
{ name: "corpName", label: "计划执行单位名称", onlyForLabel: true },
|
||||
{name: "corpName", label: "计划执行单位名称", onlyForLabel: true},
|
||||
{
|
||||
name: "userId",
|
||||
label: "计划执行人员",
|
||||
|
|
@ -359,30 +361,30 @@ const AddModalComponent = (props) => {
|
|||
};
|
||||
return props.supervision === "1"
|
||||
? (
|
||||
<PersonnelSelect
|
||||
params={{ corpinfoId: corpId }}
|
||||
isNeedCorpInfoId={true}
|
||||
isNeedDepartmentId={false}
|
||||
extraParams={{ noMain: 1 }}
|
||||
{...commonProps}
|
||||
/>
|
||||
)
|
||||
<PersonnelSelect
|
||||
params={{corpinfoId: corpId}}
|
||||
isNeedCorpInfoId={true}
|
||||
isNeedDepartmentId={false}
|
||||
extraParams={{noMain: 1}}
|
||||
{...commonProps}
|
||||
/>
|
||||
)
|
||||
: (
|
||||
<PersonnelSelect
|
||||
params={{ departmentId: userInfo.departmentId }}
|
||||
extraParams={{ noMain: 1 }}
|
||||
{...commonProps}
|
||||
/>
|
||||
);
|
||||
<PersonnelSelect
|
||||
params={{departmentId: userInfo.departmentId}}
|
||||
extraParams={{noMain: 1}}
|
||||
{...commonProps}
|
||||
/>
|
||||
);
|
||||
})(),
|
||||
},
|
||||
{ name: "userName", label: "计划执行人员名称", onlyForLabel: true },
|
||||
{ name: "departmentId", label: "计划执行人员部门", onlyForLabel: true },
|
||||
{ name: "departmentName", label: "计划执行人员部门名称", onlyForLabel: true },
|
||||
{ name: "postId", label: "计划执行人员岗位", onlyForLabel: true },
|
||||
{ name: "postName", label: "计划执行人员岗位名称", onlyForLabel: true },
|
||||
{ name: "planExecuteNum", label: "计划执行次数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{name: "userName", label: "计划执行人员名称", onlyForLabel: true},
|
||||
{name: "departmentId", label: "计划执行人员部门", onlyForLabel: true},
|
||||
{name: "departmentName", label: "计划执行人员部门名称", onlyForLabel: true},
|
||||
{name: "postId", label: "计划执行人员岗位", onlyForLabel: true},
|
||||
{name: "postName", label: "计划执行人员岗位名称", onlyForLabel: true},
|
||||
{name: "planExecuteNum", label: "计划执行次数", render: FORM_ITEM_RENDER_ENUM.NUMBER},
|
||||
{name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA},
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -401,7 +403,7 @@ const ViewModal = (props) => {
|
|||
<Button key="cancel" onClick={props.onCancel}>取消</Button>,
|
||||
]}
|
||||
>
|
||||
<ViewInfo id={props.id} supervision={props.supervision} />
|
||||
<ViewInfo id={props.id} supervision={props.supervision}/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ function PersonnelExecutionDetails(props) {
|
|||
return (
|
||||
<Page headerTitle="计划执行总次数" contentPadding="0 20px 20px 20px">
|
||||
<Divider orientation="left">计划信息</Divider>
|
||||
<ViewInfo id={query.planId} />
|
||||
<ViewInfo id={query.planId} supervision={props.supervision}/>
|
||||
<Divider orientation="left">人员执行详情</Divider>
|
||||
<Table
|
||||
headerTitle={query.userName}
|
||||
|
|
@ -28,7 +28,7 @@ function PersonnelExecutionDetails(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{
|
||||
title: "检查状态",
|
||||
dataIndex: "status",
|
||||
|
|
|
|||
|
|
@ -1,37 +1,41 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form } from "antd";
|
||||
import {Connect} from "@cqsjjb/jjb-dva-runtime";
|
||||
import {Button, Form} from "antd";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PLAN } from "~/enumerate/namespace";
|
||||
import {NS_PLAN} from "~/enumerate/namespace";
|
||||
|
||||
function PersonnelExecutionRecords(props) {
|
||||
const query = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["planUserList"], {
|
||||
const {tableProps, getData} = useTable(props["planUserList"], {
|
||||
form,
|
||||
params: { planId: query.planId },
|
||||
params: {planId: query.planId},
|
||||
});
|
||||
|
||||
return (
|
||||
<Page headerTitle="人员执行情况" contentPadding="0 20px 20px 20px">
|
||||
<Page headerTitle="人员执行情况">
|
||||
<Search
|
||||
labelCol={{ span: 4 }}
|
||||
labelCol={{span: 4}}
|
||||
options={[
|
||||
{ name: "departmentId", label: "部门", render: <DepartmentSelectTree /> },
|
||||
{ name: "userName", label: "人员" },
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "部门",
|
||||
render: <DepartmentSelectTree isNeedCorpInfoId={true} params={{eqCorpinfoId: query.corpId}}/>
|
||||
},
|
||||
{name: "userName", label: "人员"},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "部门", dataIndex: "departmentName" },
|
||||
{ title: "岗位", dataIndex: "postName" },
|
||||
{ title: "姓名", dataIndex: "userName" },
|
||||
{title: "部门", dataIndex: "departmentName"},
|
||||
{title: "岗位", dataIndex: "postName"},
|
||||
{title: "姓名", dataIndex: "userName"},
|
||||
{
|
||||
title: "计划执行情况",
|
||||
dataIndex: "planExecuteNum",
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function PlanExecutionDetails(props) {
|
|||
{ title: "被检查单位", dataIndex: "inspectionSiteDepartmentName" },
|
||||
{ title: "被检查单位现场负责人", dataIndex: "inspectedSiteManagerName", width: 200 },
|
||||
{ title: "检查类型", dataIndex: "typeName" },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (`自${record.timeStart}至${record.timeEnd}止`) },
|
||||
{ title: "检查时间", width: 200, render: (_, record) => (record.timeStart ? `自${record.timeStart}至${record.timeEnd}止` : "") },
|
||||
{
|
||||
title: "检查状态",
|
||||
dataIndex: "status",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import PersonnelExecutionDetailsA from "~/pages/Container/BranchCompany/Plan/Management/PersonnelExecutionDetails";
|
||||
|
||||
function PersonnelExecutionDetails(props) {
|
||||
return <PersonnelExecutionDetailsA {...props} />;
|
||||
return <PersonnelExecutionDetailsA {...props} supervision={"1"} />;
|
||||
}
|
||||
|
||||
export default PersonnelExecutionDetails;
|
||||
|
|
|
|||
Loading…
Reference in New Issue