改BUG
parent
6e38a7100c
commit
68a8beb85a
|
|
@ -3,6 +3,7 @@ import VirtualList from "@rc-component/virtual-list";
|
|||
import { useInterval } from "ahooks";
|
||||
import { Image, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getFileUrl } from "zy-react-library/utils";
|
||||
import { NS_RESUE } from "~/enumerate/namespace";
|
||||
import circle from "../../images/circle.png";
|
||||
|
||||
|
|
@ -88,8 +89,9 @@ function CommandFeedbackRecords(props) {
|
|||
<span className="label">现场图片:</span>
|
||||
<div>
|
||||
<Space wrap={true}>
|
||||
|
||||
{(feedback.feedbackImageUrl ? feedback.feedbackImageUrl.split(",") : []).map((img, imgIndex) => (
|
||||
<Image key={imgIndex} src={img} alt="feedback" width={60} height={60} />
|
||||
<Image key={imgIndex} src={getFileUrl() + img} alt="feedback" width={60} height={60} />
|
||||
))}
|
||||
</Space>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
|||
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||
import EditIcon from "zy-react-library/components/Icon/EditIcon";
|
||||
import BasicLeftTree from "zy-react-library/components/LeftTree/Basic";
|
||||
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { PHONE } from "zy-react-library/regular";
|
||||
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||
|
|
@ -22,7 +24,6 @@ const addModalTypeNames = {
|
|||
|
||||
function OrganizationStructure(props) {
|
||||
const [treeList, setTreeList] = useState([]);
|
||||
|
||||
const [parentId, setParentId] = useState(defaultParentId);
|
||||
const [parentName, setParentName] = useState(defaultParentName);
|
||||
const [currentOrganization, setCurrentOrganization] = useState({});
|
||||
|
|
@ -32,13 +33,19 @@ function OrganizationStructure(props) {
|
|||
|
||||
const [currentOrganizationPersonnelId, setCurrentOrganizationPersonnelId] = useState("");
|
||||
const [addOrganizationPersonnelModalVisible, setAddOrganizationPersonnelModalVisible] = useState(false);
|
||||
const [corpinfoid, setCorpinfoid] = useState("");
|
||||
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
|
||||
const { tableProps, getData } = useTable(props["enterprisePlanOrganizationPersonnelList"], {
|
||||
params: { planId: props.planId, organizationId: currentOrganization.id },
|
||||
useStorageQueryCriteria: false,
|
||||
manual: true,
|
||||
});
|
||||
|
||||
const getInfoData = async () => {
|
||||
const data = await getUserInfo();
|
||||
setCorpinfoid(data.corpinfoId);
|
||||
};
|
||||
const getTreeList = async () => {
|
||||
const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
|
||||
setTreeList(data);
|
||||
|
|
@ -46,6 +53,7 @@ function OrganizationStructure(props) {
|
|||
|
||||
useEffect(() => {
|
||||
getTreeList();
|
||||
getInfoData();
|
||||
}, []);
|
||||
|
||||
const onDeleteOrganization = () => {
|
||||
|
|
@ -226,6 +234,7 @@ function OrganizationStructure(props) {
|
|||
setCurrentOrganizationPersonnelId("");
|
||||
}}
|
||||
id={currentOrganizationPersonnelId}
|
||||
corpinfoid={corpinfoid}
|
||||
organizationId={currentOrganization.id}
|
||||
organizationName={currentOrganization.orgName}
|
||||
planId={props.planId}
|
||||
|
|
@ -349,12 +358,25 @@ const AddOrganizationPersonnelModalComponent = (props) => {
|
|||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
options={[
|
||||
|
||||
{
|
||||
key: "organizationName",
|
||||
label: "所属机构",
|
||||
render: (<Tag color="#4096ff">{props.organizationName}</Tag>),
|
||||
},
|
||||
{ name: "userName", label: "姓名" },
|
||||
{ name: "userId", label: "姓名", render: (
|
||||
<PersonnelSelect
|
||||
isNeedDepartmentId={false}
|
||||
isNeedCorpInfoId={true}
|
||||
params={{ corpinfoId: props.corpinfoid }}
|
||||
onGetLabel={label => form.setFieldValue("userName", label)}
|
||||
onGetOption={(value) => {
|
||||
form.setFieldValue("position", value.postName);
|
||||
form.setFieldValue("contactPhone", value.phone);
|
||||
}}
|
||||
/>
|
||||
) },
|
||||
{ name: "userName", label: "人员名称", onlyForLabel: true },
|
||||
{ name: "position", label: "职务" },
|
||||
{ name: "groupPost", label: "组内岗位", required: false },
|
||||
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ function PlanInstructions(props) {
|
|||
|
||||
const [responseLevelList, setResponseLevelList] = useState([]);
|
||||
const [executingAgencyListTree, setExecutingAgencyListTree] = useState([]);
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
const [userData, setUserData] = useState([]);
|
||||
const isEditCommandIdRef = useRef("");
|
||||
|
||||
const { tableProps, getData } = useTable(props["enterprisePlanCommandSettingList"], {
|
||||
|
|
@ -28,11 +30,14 @@ function PlanInstructions(props) {
|
|||
const { data } = await props["enterprisePlanLevelResponseListAll"]({ planId: props.planId });
|
||||
setResponseLevelList(data);
|
||||
};
|
||||
const getUserDataFun = async (value) => {
|
||||
const { data } = await props["enterprisePlanOrganizationPersonnelListAll"]({ organizationId: value.id });
|
||||
setUserData(data);
|
||||
};
|
||||
|
||||
const getTreeList = async () => {
|
||||
if (props.mode === "view")
|
||||
return;
|
||||
|
||||
const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
|
||||
setExecutingAgencyListTree(data);
|
||||
};
|
||||
|
|
@ -47,8 +52,6 @@ function PlanInstructions(props) {
|
|||
...values,
|
||||
responseLevel: values.responseLevel.join(","),
|
||||
responseLevelName: values.responseLevelName.join(","),
|
||||
executingAgencyId: values.executingAgencyId.join(","),
|
||||
executingAgencyName: values.executingAgencyName.join(","),
|
||||
planId: props.planId,
|
||||
id: isEditCommandIdRef.current,
|
||||
});
|
||||
|
|
@ -69,6 +72,7 @@ function PlanInstructions(props) {
|
|||
if (success) {
|
||||
message.success("删除成功");
|
||||
form.resetFields();
|
||||
setUserData([]);
|
||||
getData();
|
||||
isEditCommandIdRef.current = "";
|
||||
}
|
||||
|
|
@ -116,16 +120,34 @@ function PlanInstructions(props) {
|
|||
label: "执行机构",
|
||||
render: (
|
||||
<BasicSelectTree
|
||||
disabled={disabled}
|
||||
treeData={executingAgencyListTree}
|
||||
nameKey="orgName"
|
||||
multiple
|
||||
onGetLabel={(label) => {
|
||||
form.setFieldValue("executingAgencyName", label);
|
||||
form.setFieldValue("userIds", undefined);
|
||||
form.setFieldValue("userNames", undefined);
|
||||
}}
|
||||
getNodePathsIsIncludeOneself={true}
|
||||
onGetNodePaths={nodes => getUserDataFun(nodes[nodes.length - 1])}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{ name: "executingAgencyName", label: "执行机构名称", onlyForLabel: true },
|
||||
{
|
||||
name: "userIds",
|
||||
label: "执行人员",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: userData,
|
||||
componentProps: { mode: "multiple", onChange: (value) => {
|
||||
const result = userData
|
||||
.filter(item => value.includes(item.id))
|
||||
.map(item => item.userName);
|
||||
form.setFieldValue("userNames", result);
|
||||
}, disabled },
|
||||
itemsField: { valueKey: "id", labelKey: "userName" },
|
||||
},
|
||||
{ name: "userNames", label: "执行人员名称", onlyForLabel: true },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={onSubmit}
|
||||
|
|
@ -142,6 +164,7 @@ function PlanInstructions(props) {
|
|||
</Button>
|
||||
<Button onClick={() => {
|
||||
form.resetFields();
|
||||
setDisabled(false);
|
||||
}}
|
||||
>
|
||||
重置
|
||||
|
|
@ -158,6 +181,7 @@ function PlanInstructions(props) {
|
|||
{ title: "响应级别", dataIndex: "responseLevelName" },
|
||||
{ title: "指令内容", dataIndex: "commandContent" },
|
||||
{ title: "执行机构", dataIndex: "executingAgencyName" },
|
||||
{ title: "执行人员", dataIndex: "userName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
|
|
@ -170,12 +194,17 @@ function PlanInstructions(props) {
|
|||
onClick={async () => {
|
||||
const { data } = await props["enterprisePlanCommandSettingInfo"]({ id: record.id });
|
||||
isEditCommandIdRef.current = record.id;
|
||||
getUserDataFun(data.executingAgencyId);
|
||||
|
||||
setDisabled(true);
|
||||
form.setFieldsValue({
|
||||
responseLevel: data.responseLevel ? data.responseLevel.split(",") : [],
|
||||
responseLevelName: data.responseLevelName ? data.responseLevelName.split(",") : [],
|
||||
commandContent: data.commandContent,
|
||||
executingAgencyId: data.executingAgencyId ? data.executingAgencyId.split(",") : [],
|
||||
executingAgencyName: data.executingAgencyName ? data.executingAgencyName.split(",") : [],
|
||||
executingAgencyId: data.executingAgencyId,
|
||||
executingAgencyName: data.executingAgencyName,
|
||||
userIds: [data.userId],
|
||||
userNames: [data.userName],
|
||||
});
|
||||
}}
|
||||
>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ function List(props) {
|
|||
});
|
||||
|
||||
return (
|
||||
<Page isShowAllAction={false}>
|
||||
<Page headerTitle="查看">
|
||||
<Search
|
||||
options={[
|
||||
{ name: "corpName", label: "公司名称" },
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ function List(props) {
|
|||
{ title: "公司名称", dataIndex: "corpName" },
|
||||
{
|
||||
title: "救援次数",
|
||||
dataIndex: "isRescueExecutedCount",
|
||||
dataIndex: "eventReportCount",
|
||||
render: (_, record) => (
|
||||
permissionButtonByStatistics({
|
||||
permission: props.permission("jgd-rescue"),
|
||||
url: `./todo/list?corpinfoId=${record.corpinfoId}`,
|
||||
text: record.isRescueExecutedCount,
|
||||
url: `./RescueList?corpinfoId=${record.corpinfoId}`,
|
||||
text: record.eventReportCount,
|
||||
history: props.history,
|
||||
})
|
||||
),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Space } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
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 { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_EVENT_REPORT, NS_RESUE } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
const [form] = Search.useForm();
|
||||
const query = useGetUrlQuery();
|
||||
|
||||
const { tableProps, getData } = useTable(props["eventReportList"], {
|
||||
form,
|
||||
usePermission: false,
|
||||
params: { isEventOrRescue: 2, corpId: query.corpinfoId },
|
||||
});
|
||||
|
||||
return (
|
||||
<Page headerTitle="救援次数">
|
||||
<Search
|
||||
options={[
|
||||
{ name: "ownerName", label: "机主姓名" },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "接入电话", dataIndex: "incomingCall" },
|
||||
{ title: "机主姓名", dataIndex: "ownerName" },
|
||||
{ title: "接入方式", dataIndex: "accessModeName" },
|
||||
{ title: "事件类型", dataIndex: "eventType" },
|
||||
{ title: "接报时间", dataIndex: "reportTime" },
|
||||
{
|
||||
title: "救援状态",
|
||||
dataIndex: "isRescueExecuted",
|
||||
render: (_, record) => getLabelName({ list: [
|
||||
{ bianma: 1, name: "未执行" },
|
||||
{ bianma: 2, name: "未开始" },
|
||||
{ bianma: 3, name: "进行中" },
|
||||
{ bianma: 4, name: "已完成" },
|
||||
], status: record.isRescueExecuted }),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{/* {(record.isEventReportSpecial === 2 && props.permission("qyd-rescue-view")) && ( */}
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
查看专报
|
||||
</Button>
|
||||
{/* // )} */}
|
||||
|
||||
{/* { */}
|
||||
{/* (record.isRescueExecuted === 4 && props.permission("qyd-rescue-rescue-record")) && ( */}
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
const params = new URLSearchParams({
|
||||
id: record.id || "",
|
||||
eventTitle: record.eventTitle || "",
|
||||
executorDeptName: record.executorDeptName || "",
|
||||
executorName: record.executorName || "",
|
||||
executionTime: record.executionTime ? dayjs(record.executionTime).format("YYYY-MM-DD HH:mm:ss") : "",
|
||||
updateTime: record.updateTime ? dayjs(record.updateTime).format("YYYY-MM-DD HH:mm:ss") : "",
|
||||
});
|
||||
props.history.push(`./rescueRecord?${params.toString()}`);
|
||||
}}
|
||||
>
|
||||
救援记录
|
||||
</Button>
|
||||
{/* ) */}
|
||||
{/* } */}
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...
|
||||
tableProps
|
||||
}
|
||||
/>
|
||||
</Page>
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
export default Connect([NS_EVENT_REPORT, NS_RESUE], true)(Permission(List));
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import ViewPage from "~/pages/Container/Enterprise/EmergencyRescue/Rescue/RescueRecord";
|
||||
|
||||
function RescueRecord(props) {
|
||||
return (<ViewPage {...props} />);
|
||||
}
|
||||
|
||||
export default RescueRecord;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import ViewPage from "~/pages/Container/Enterprise/EmergencyRescue/Rescue/View";
|
||||
|
||||
function Viev(props) {
|
||||
return (<ViewPage {...props} />);
|
||||
}
|
||||
|
||||
export default Viev;
|
||||
Loading…
Reference in New Issue