parent
a0ddfd8ae9
commit
58da2bbb60
|
|
@ -18,6 +18,7 @@
|
||||||
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@ahooksjs/use-url-state": "^3.5.1",
|
||||||
"@ant-design/icons": "^5.6.1",
|
"@ant-design/icons": "^5.6.1",
|
||||||
"@ant-design/pro-components": "^2.8.10",
|
"@ant-design/pro-components": "^2.8.10",
|
||||||
"@cqsjjb/jjb-common-decorator": "latest",
|
"@cqsjjb/jjb-common-decorator": "latest",
|
||||||
|
|
@ -30,7 +31,7 @@
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"zy-react-library": "^1.2.23"
|
"zy-react-library": "^1.2.28"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^5.4.1",
|
"@antfu/eslint-config": "^5.4.1",
|
||||||
|
|
|
||||||
|
|
@ -64,3 +64,5 @@
|
||||||
`/emergencyRescue/container/enterprise/emergencyOrganization/emergencyRescueTeam/list`
|
`/emergencyRescue/container/enterprise/emergencyOrganization/emergencyRescueTeam/list`
|
||||||
- 预案与演练/企业预案管理
|
- 预案与演练/企业预案管理
|
||||||
`/emergencyRescue/container/enterprise/planAndDrill/enterprisePlan/list`
|
`/emergencyRescue/container/enterprise/planAndDrill/enterprisePlan/list`
|
||||||
|
- 预案与演练/应急预案管理
|
||||||
|
`/emergencyRescue/container/enterprise/planAndDrill/emergencyPlan/list`
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const emergencyPlanList = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyPlanManagement/list",
|
||||||
|
);
|
||||||
|
export const emergencyPlanInfo = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyPlanManagement/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyPlanAdd = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Post > @/emergencyRescue/emergencyPlanManagement/save",
|
||||||
|
);
|
||||||
|
export const emergencyPlanUpdate = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Put > @/emergencyRescue/emergencyPlanManagement/edit",
|
||||||
|
);
|
||||||
|
export const emergencyPlanDelete = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyPlanManagement/{id}",
|
||||||
|
);
|
||||||
|
export const emergencyPlanDeleteBatch = declareRequest(
|
||||||
|
"emergencyPlanLoading",
|
||||||
|
"Delete > @/emergencyRescue/emergencyPlanManagement/ids?ids={ids}",
|
||||||
|
);
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
|
||||||
|
export const enterprisePlanBasicInfoList = declareRequest(
|
||||||
|
"enterprisePlanBasicInfoLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanBasicInfo/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanBasicInfoInfo = declareRequest(
|
||||||
|
"enterprisePlanBasicInfoLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanBasicInfo/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanBasicInfoAdd = declareRequest(
|
||||||
|
"enterprisePlanBasicInfoLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanBasicInfo/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanBasicInfoUpdate = declareRequest(
|
||||||
|
"enterprisePlanBasicInfoLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanBasicInfo/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanBasicInfoDelete = declareRequest(
|
||||||
|
"enterprisePlanBasicInfoLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanBasicInfo/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseList = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanLevelResponse/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseListAll = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanLevelResponse/listAll",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseInfo = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanLevelResponse/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseAdd = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanLevelResponse/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseUpdate = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanLevelResponse/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelResponseDelete = declareRequest(
|
||||||
|
"enterprisePlanLevelResponseLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanLevelResponse/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelOrganizationListTree = declareRequest(
|
||||||
|
"enterprisePlanLevelOrganizationLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanOrganization/listTree",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelOrganizationInfo = declareRequest(
|
||||||
|
"enterprisePlanLevelOrganizationLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanOrganization/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelOrganizationAdd = declareRequest(
|
||||||
|
"enterprisePlanLevelOrganizationLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanOrganization/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelOrganizationUpdate = declareRequest(
|
||||||
|
"enterprisePlanLevelOrganizationLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanOrganization/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanLevelOrganizationDelete = declareRequest(
|
||||||
|
"enterprisePlanLevelOrganizationLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanOrganization/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanOrganizationPersonnelList = declareRequest(
|
||||||
|
"enterprisePlanOrganizationPersonnelLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanOrganizationPersonnel/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanOrganizationPersonnelInfo = declareRequest(
|
||||||
|
"enterprisePlanOrganizationPersonnelLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanOrganizationPersonnel/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanOrganizationPersonnelAdd = declareRequest(
|
||||||
|
"enterprisePlanOrganizationPersonnelLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanOrganizationPersonnel/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanOrganizationPersonnelUpdate = declareRequest(
|
||||||
|
"enterprisePlanOrganizationPersonnelLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanOrganizationPersonnel/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanOrganizationPersonnelDelete = declareRequest(
|
||||||
|
"enterprisePlanOrganizationPersonnelLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanOrganizationPersonnel/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanResourceList = declareRequest(
|
||||||
|
"enterprisePlanResourceLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanResource/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanResourceInfo = declareRequest(
|
||||||
|
"enterprisePlanResourceLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanResource/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanResourceAdd = declareRequest(
|
||||||
|
"enterprisePlanResourceLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanResource/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanResourceUpdate = declareRequest(
|
||||||
|
"enterprisePlanResourceLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanResource/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanResourceDelete = declareRequest(
|
||||||
|
"enterprisePlanResourceLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanResource/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanCommandSettingList = declareRequest(
|
||||||
|
"enterprisePlanCommandSettingLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanCommandSetting/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanCommandSettingInfo = declareRequest(
|
||||||
|
"enterprisePlanCommandSettingLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanCommandSetting/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanCommandSettingAdd = declareRequest(
|
||||||
|
"enterprisePlanCommandSettingLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanCommandSetting/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanCommandSettingUpdate = declareRequest(
|
||||||
|
"enterprisePlanCommandSettingLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanCommandSetting/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanCommandSettingDelete = declareRequest(
|
||||||
|
"enterprisePlanCommandSettingLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanCommandSetting/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanAttachmentList = declareRequest(
|
||||||
|
"enterprisePlanAttachmentLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanAttachment/list",
|
||||||
|
);
|
||||||
|
export const enterprisePlanAttachmentInfo = declareRequest(
|
||||||
|
"enterprisePlanAttachmentLoading",
|
||||||
|
"Get > /emergencyRescue/enterprisePlanAttachment/{id}",
|
||||||
|
);
|
||||||
|
export const enterprisePlanAttachmentAdd = declareRequest(
|
||||||
|
"enterprisePlanAttachmentLoading",
|
||||||
|
"Post > @/emergencyRescue/enterprisePlanAttachment/save",
|
||||||
|
);
|
||||||
|
export const enterprisePlanAttachmentUpdate = declareRequest(
|
||||||
|
"enterprisePlanAttachmentLoading",
|
||||||
|
"Put > @/emergencyRescue/enterprisePlanAttachment/edit",
|
||||||
|
);
|
||||||
|
export const enterprisePlanAttachmentDelete = declareRequest(
|
||||||
|
"enterprisePlanAttachmentLoading",
|
||||||
|
"Delete > @/emergencyRescue/enterprisePlanAttachment/{id}",
|
||||||
|
);
|
||||||
|
|
@ -44,3 +44,7 @@ export const expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertDele
|
||||||
"expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertLoading",
|
"expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertLoading",
|
||||||
"Delete > @/emergencyRescue/emergencyRescueExpertGroupRel/ids?ids={ids}",
|
"Delete > @/emergencyRescue/emergencyRescueExpertGroupRel/ids?ids={ids}",
|
||||||
);
|
);
|
||||||
|
export const expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertCheckList = declareRequest(
|
||||||
|
"expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertLoading",
|
||||||
|
"Get > /emergencyRescue/emergencyRescueExpertGroupRel/listAll",
|
||||||
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
||||||
|
export const ENTERPRISE_PLAN_AUDIT_STATUS_ENUM = [
|
||||||
|
{ name: "待审核", bianma: "1" },
|
||||||
|
{ name: "已通过", bianma: "2" },
|
||||||
|
{ name: "已驳回", bianma: "3" },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const EMERGENCY_PLAN_FILING_STATUS_ENUM = [
|
||||||
|
{ name: "已备案", bianma: "1" },
|
||||||
|
{ name: "未备案", bianma: "2" },
|
||||||
|
];
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,5 @@ export const NS_TECHNICAL_SUPPORT_GUARANTEE_ORGANIZATION = defineNamespace("tech
|
||||||
export const NS_ENTERPRISE_EMERGENCY_ORGANIZATION = defineNamespace("enterpriseEmergencyOrganization");
|
export const NS_ENTERPRISE_EMERGENCY_ORGANIZATION = defineNamespace("enterpriseEmergencyOrganization");
|
||||||
export const NS_ENTERPRISE_EMERGENCY_PERSONNEL = defineNamespace("enterpriseEmergencyPersonnel");
|
export const NS_ENTERPRISE_EMERGENCY_PERSONNEL = defineNamespace("enterpriseEmergencyPersonnel");
|
||||||
export const NS_EMERGENCY_RESCUE_TEAM = defineNamespace("emergencyRescueTeam");
|
export const NS_EMERGENCY_RESCUE_TEAM = defineNamespace("emergencyRescueTeam");
|
||||||
|
export const NS_ENTERPRISE_PLAN = defineNamespace("enterprisePlan");
|
||||||
|
export const NS_EMERGENCY_PLAN = defineNamespace("emergencyPlan");
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ function Add(props) {
|
||||||
{ name: "workUnit", label: "工作单位" },
|
{ name: "workUnit", label: "工作单位" },
|
||||||
{ name: "unitSupervisorDepartment", label: "单位主管部门" },
|
{ name: "unitSupervisorDepartment", label: "单位主管部门" },
|
||||||
{ name: "unitPostalCode", label: "单位邮编", rules: [{ pattern: POSTAL_CODE, message: "请输入正确的单位邮编" }] },
|
{ name: "unitPostalCode", label: "单位邮编", rules: [{ pattern: POSTAL_CODE, message: "请输入正确的单位邮编" }] },
|
||||||
{ name: "sortOrder", label: "排序号", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "sortOrder", label: "排序号", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "expertise", label: "专家特长" },
|
{ name: "expertise", label: "专家特长" },
|
||||||
{ name: "mainAchievements", label: "主要成果" },
|
{ name: "mainAchievements", label: "主要成果" },
|
||||||
{ name: "emergencyWorkExperience", label: "应急工作经历" },
|
{ name: "emergencyWorkExperience", label: "应急工作经历" },
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ function Add(props) {
|
||||||
{ name: "groupLevelName", label: "专家组级别名称", onlyForLabel: true },
|
{ name: "groupLevelName", label: "专家组级别名称", onlyForLabel: true },
|
||||||
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的联系电话" }] },
|
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的联系电话" }] },
|
||||||
{ name: "fax", label: "传真", rules: [{ pattern: TEL_PHONE, message: "请输入正确的传真" }] },
|
{ name: "fax", label: "传真", rules: [{ pattern: TEL_PHONE, message: "请输入正确的传真" }] },
|
||||||
{ name: "memberCount", label: "人数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "memberCount", label: "人数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "establishUnit", label: "组建单位" },
|
{ name: "establishUnit", label: "组建单位" },
|
||||||
{ name: "establishUnitPostalCode", label: "组件单位邮编", rules: [{ pattern: POSTAL_CODE, message: "请输入正确的组件单位邮编" }] },
|
{ name: "establishUnitPostalCode", label: "组件单位邮编", rules: [{ pattern: POSTAL_CODE, message: "请输入正确的组件单位邮编" }] },
|
||||||
{ name: "establishUnitAddress", label: "组建单位地址", span: 24 },
|
{ name: "establishUnitAddress", label: "组建单位地址", span: 24 },
|
||||||
|
|
@ -84,7 +84,7 @@ function Add(props) {
|
||||||
{ name: "contactMobilePhone", label: "联系人移动电话", rules: [{ pattern: PHONE, message: "请输入正确的联系人移动电话" }] },
|
{ name: "contactMobilePhone", label: "联系人移动电话", rules: [{ pattern: PHONE, message: "请输入正确的联系人移动电话" }] },
|
||||||
{ name: "contactHomePhone", label: "联系人住宅电话", rules: [{ pattern: TEL_PHONE, message: "请输入正确的联系人住宅电话" }] },
|
{ name: "contactHomePhone", label: "联系人住宅电话", rules: [{ pattern: TEL_PHONE, message: "请输入正确的联系人住宅电话" }] },
|
||||||
{ name: "contactEmail", label: "联系人电子邮箱", rules: [{ type: "email", message: "请输入正确的联系人电子邮箱" }] },
|
{ name: "contactEmail", label: "联系人电子邮箱", rules: [{ type: "email", message: "请输入正确的联系人电子邮箱" }] },
|
||||||
{ name: "sortOrder", label: "排序号", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "sortOrder", label: "排序号", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "groupIntroduction", label: "专家组介绍", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
{ name: "groupIntroduction", label: "专家组介绍", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
{ name: "remarks", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
{ name: "remarks", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
]}
|
]}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { Button, message, Modal, Space } from "antd";
|
import { Button, message, Modal, Space } from "antd";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
import Page from "zy-react-library/components/Page";
|
import Page from "zy-react-library/components/Page";
|
||||||
|
|
@ -8,6 +8,7 @@ import Search from "zy-react-library/components/Search";
|
||||||
import Table from "zy-react-library/components/Table";
|
import Table from "zy-react-library/components/Table";
|
||||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
import useTable from "zy-react-library/hooks/useTable";
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { ArrayDeduplication } from "zy-react-library/utils";
|
||||||
import { NS_EXPERT_EMERGENCY_RESCUE_EXPERT, NS_EXPERT_EMERGENCY_RESCUE_EXPERT_GROUP } from "~/enumerate/namespace";
|
import { NS_EXPERT_EMERGENCY_RESCUE_EXPERT, NS_EXPERT_EMERGENCY_RESCUE_EXPERT_GROUP } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function List(props) {
|
function List(props) {
|
||||||
|
|
@ -142,6 +143,7 @@ function List(props) {
|
||||||
|
|
||||||
const AddModalComponent = (props) => {
|
const AddModalComponent = (props) => {
|
||||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
const [disabledRowKeys, setDisabledRowKeys] = useState([]);
|
||||||
|
|
||||||
const [form] = Search.useForm();
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
|
@ -150,17 +152,27 @@ const AddModalComponent = (props) => {
|
||||||
useStorageQueryCriteria: false,
|
useStorageQueryCriteria: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getCheckList = async () => {
|
||||||
|
const { data } = await props["expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertCheckList"]({ likeGroupId: props.groupId });
|
||||||
|
setDisabledRowKeys(data.map(item => item.expertId));
|
||||||
|
setSelectedRowKeys(data.map(item => item.expertId));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getCheckList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
if (selectedRowKeys.length === 0) {
|
if (selectedRowKeys.length === 0) {
|
||||||
return message.warning("请选择要添加的记录");
|
return message.warning("请选择要添加的记录");
|
||||||
}
|
}
|
||||||
const { success } = props["expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertAddBatch"]({
|
const { success } = await props["expertEmergencyRescueExpertGroupDownExpertEmergencyRescueExpertAddBatch"]({
|
||||||
expertIds: selectedRowKeys,
|
expertIds: ArrayDeduplication(selectedRowKeys),
|
||||||
groupId: props.groupId,
|
groupId: props.groupId,
|
||||||
});
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success("添加成功");
|
message.success("添加成功");
|
||||||
props.onClose();
|
props.onCancel();
|
||||||
props.getData();
|
props.getData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -190,6 +202,9 @@ const AddModalComponent = (props) => {
|
||||||
onChange: (selectedRowKeys) => {
|
onChange: (selectedRowKeys) => {
|
||||||
setSelectedRowKeys(selectedRowKeys);
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
},
|
},
|
||||||
|
getCheckboxProps: record => ({
|
||||||
|
disabled: disabledRowKeys.includes(record.id),
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
options={false}
|
options={false}
|
||||||
disabledResizer={true}
|
disabledResizer={true}
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ function Add(props) {
|
||||||
},
|
},
|
||||||
{ name: "supervisorUnitName", label: "主管单位名称", onlyForLabel: true },
|
{ name: "supervisorUnitName", label: "主管单位名称", onlyForLabel: true },
|
||||||
{ name: "supervisorUnitAddress", label: "主管单位地址" },
|
{ name: "supervisorUnitAddress", label: "主管单位地址" },
|
||||||
{ name: "totalPeople", label: "总人数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "totalPeople", label: "总人数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "establishDate", label: "成立时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
{ name: "establishDate", label: "成立时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||||
{ name: "emergencyCommunication", label: "应急通讯方式", span: 24 },
|
{ name: "emergencyCommunication", label: "应急通讯方式", span: 24 },
|
||||||
{ name: "mainDuty", label: "主要职责", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
{ name: "mainDuty", label: "主要职责", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ function Add(props) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ name: "genderName", label: "性别名称", onlyForLabel: true },
|
{ name: "genderName", label: "性别名称", onlyForLabel: true },
|
||||||
{ name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{
|
{
|
||||||
name: "mobilePhone",
|
name: "mobilePhone",
|
||||||
label: "手机号",
|
label: "手机号",
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ function Add(props) {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{ name: "userName", label: "用户名称", onlyForLabel: true },
|
{ name: "userName", label: "用户名称", onlyForLabel: true },
|
||||||
{ name: "sortOrder", label: "排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "sortOrder", label: "排序", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "genderName", label: "性别", componentProps: { disabled: true } },
|
{ name: "genderName", label: "性别", componentProps: { disabled: true } },
|
||||||
{ name: "gender", label: "性别ID", onlyForLabel: true },
|
{ name: "gender", label: "性别ID", onlyForLabel: true },
|
||||||
{ name: "administrativePosition", label: "行政职务" },
|
{ name: "administrativePosition", label: "行政职务" },
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,10 @@ function Add(props) {
|
||||||
label: "应急值班电话",
|
label: "应急值班电话",
|
||||||
rules: [{ pattern: TEL_PHONE, message: "请输入正确的应急值班电话" }],
|
rules: [{ pattern: TEL_PHONE, message: "请输入正确的应急值班电话" }],
|
||||||
},
|
},
|
||||||
{ name: "totalPeople", label: "总人数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "totalPeople", label: "总人数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "commanderCount", label: "指战人数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "commanderCount", label: "指战人数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "vehicleCount", label: "车辆数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "vehicleCount", label: "车辆数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "logisticsCount", label: "后勤人数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "logisticsCount", label: "后勤人数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{
|
{
|
||||||
name: "rescueMajor",
|
name: "rescueMajor",
|
||||||
label: "救援专业",
|
label: "救援专业",
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,10 @@ function Add(props) {
|
||||||
},
|
},
|
||||||
{ name: "regionCodeName", label: "所属区域名称", onlyForLabel: true },
|
{ name: "regionCodeName", label: "所属区域名称", onlyForLabel: true },
|
||||||
{ key: "map", customizeRender: true, render: (<Map type="cesium" />), span: 24 },
|
{ key: "map", customizeRender: true, render: (<Map type="cesium" />), span: 24 },
|
||||||
{ name: "emergencyCommunicationVehicleCount", label: "应急通讯车数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "emergencyCommunicationVehicleCount", label: "应急通讯车数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "emergencyGeneratorVehicleCount", label: "应急发电车数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "emergencyGeneratorVehicleCount", label: "应急发电车数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "satellitePhoneCount", label: "卫星电话数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "satellitePhoneCount", label: "卫星电话数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "baseStationTotalCount", label: "基站总数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "baseStationTotalCount", label: "基站总数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "emergencyCommunicationMode", label: "应急通讯方式", span: 24 },
|
{ name: "emergencyCommunicationMode", label: "应急通讯方式", span: 24 },
|
||||||
{ name: "leaderName", label: "负责人", rules: [{ required: true, message: "请输入负责人" }] },
|
{ name: "leaderName", label: "负责人", rules: [{ required: true, message: "请输入负责人" }] },
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,10 @@ function Add(props) {
|
||||||
},
|
},
|
||||||
{ name: "regionCodeName", label: "所属区域名称", onlyForLabel: true },
|
{ name: "regionCodeName", label: "所属区域名称", onlyForLabel: true },
|
||||||
{ key: "map", customizeRender: true, render: (<Map type="cesium" />), span: 24 },
|
{ key: "map", customizeRender: true, render: (<Map type="cesium" />), span: 24 },
|
||||||
{ name: "bedCount", label: "病床数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "bedCount", label: "病床数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "doctorCount", label: "医生数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "doctorCount", label: "医生数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "nurseCount", label: "护士数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "nurseCount", label: "护士数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "ambulanceCount", label: "急救车辆数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "ambulanceCount", label: "急救车辆数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "emergencyCommunication", label: "应急通讯方式", span: 24 },
|
{ name: "emergencyCommunication", label: "应急通讯方式", span: 24 },
|
||||||
{ name: "leaderName", label: "负责人", rules: [{ required: true, message: "请输入负责人" }] },
|
{ name: "leaderName", label: "负责人", rules: [{ required: true, message: "请输入负责人" }] },
|
||||||
{
|
{
|
||||||
|
|
@ -136,7 +136,7 @@ function Add(props) {
|
||||||
{ name: "supervisorUnitAddress", label: "主管单位地址" },
|
{ name: "supervisorUnitAddress", label: "主管单位地址" },
|
||||||
{ name: "features", label: "特色", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
{ name: "features", label: "特色", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
{ name: "mainMedicalEquipment", label: "主要医疗设备" },
|
{ name: "mainMedicalEquipment", label: "主要医疗设备" },
|
||||||
{ name: "anticoagulationTreatmentCount", label: "抗震设防列数", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "anticoagulationTreatmentCount", label: "抗震设防列数", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "remarks", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
{ name: "remarks", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
]}
|
]}
|
||||||
form={form}
|
form={form}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ function Add(props) {
|
||||||
{ name: "warehouseName", label: "资源库名称" },
|
{ name: "warehouseName", label: "资源库名称" },
|
||||||
{ name: "address", label: "所在地点" },
|
{ name: "address", label: "所在地点" },
|
||||||
{ name: "resourceCategory", label: "存放资源类别" },
|
{ name: "resourceCategory", label: "存放资源类别" },
|
||||||
{ name: "resourceQuantity", label: "资源数量", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
{ name: "resourceQuantity", label: "资源数量", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
{ name: "contactPerson", label: "联系人" },
|
{ name: "contactPerson", label: "联系人" },
|
||||||
{ name: "contactPhone", label: "联系人电话", rules: [{ pattern: TEL_PHONE, message: "请输入正确的电话号码" }] },
|
{ name: "contactPhone", label: "联系人电话", rules: [{ pattern: TEL_PHONE, message: "请输入正确的电话号码" }] },
|
||||||
{ name: "contactMobile", label: "联系手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
{ name: "contactMobile", label: "联系手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,12 @@ function Add(props) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const { data } = await props["facilitiesEquipmentInfo"]({ id: query.id });
|
const { data } = await props["facilitiesEquipmentInfo"]({ id: query.id });
|
||||||
|
const files = [];
|
||||||
|
if (data.fileId) {
|
||||||
fileIdRef.current = data.fileId;
|
fileIdRef.current = data.fileId;
|
||||||
const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[701], eqForeignKey: data.fileId });
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[701], eqForeignKey: data.fileId });
|
||||||
|
files.push(...fileItems);
|
||||||
|
}
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...data,
|
...data,
|
||||||
files,
|
files,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,11 @@ function View(props) {
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const { data } = await props["facilitiesEquipmentInfo"]({ id: query.id });
|
const { data } = await props["facilitiesEquipmentInfo"]({ id: query.id });
|
||||||
const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[701], eqForeignKey: data.fileId });
|
const files = [];
|
||||||
|
if (data.fileId) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[701], eqForeignKey: data.fileId });
|
||||||
|
files.push(...fileItems);
|
||||||
|
}
|
||||||
setInfo({
|
setInfo({
|
||||||
...data,
|
...data,
|
||||||
files,
|
files,
|
||||||
|
|
@ -64,7 +68,7 @@ function View(props) {
|
||||||
{ label: "第二联系人", children: info.secondContactPerson },
|
{ label: "第二联系人", children: info.secondContactPerson },
|
||||||
{ label: "第二联系人电话", children: info.secondContactPhone },
|
{ label: "第二联系人电话", children: info.secondContactPhone },
|
||||||
{ label: "概述", children: info.summary },
|
{ label: "概述", children: info.summary },
|
||||||
{ label: "附件", children: previewFile(info.files) },
|
{ label: "附件", children: previewFile(info.files), span: 2 },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</Spin>
|
</Spin>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,164 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { message } from "antd";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||||
|
import Upload from "zy-react-library/components/Upload";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||||
|
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||||
|
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { EMERGENCY_PLAN_FILING_STATUS_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_EMERGENCY_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function Add(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||||
|
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||||
|
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const fileIdRef = useRef("");
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!query.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["emergencyPlanInfo"]({ id: query.id });
|
||||||
|
const files = [];
|
||||||
|
if (data.fileId) {
|
||||||
|
fileIdRef.current = data.fileId;
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[703], eqForeignKey: data.fileId });
|
||||||
|
files.push(...fileItems);
|
||||||
|
}
|
||||||
|
form.setFieldsValue({
|
||||||
|
...data,
|
||||||
|
files,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await deleteFile({ single: false, files: values.deleteFiles });
|
||||||
|
const { id: fileId } = await uploadFile({
|
||||||
|
single: false,
|
||||||
|
files: values.files,
|
||||||
|
params: { type: UPLOAD_FILE_TYPE_ENUM[703], foreignKey: fileIdRef.current },
|
||||||
|
});
|
||||||
|
const { success } = await props[query.id ? "emergencyPlanUpdate" : "emergencyPlanAdd"]({
|
||||||
|
...values,
|
||||||
|
fileId,
|
||||||
|
id: query.id,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(query.id ? "编辑成功" : "新增成功");
|
||||||
|
props.history.goBack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.emergencyPlan.emergencyPlanLoading || getFileLoading || uploadFileLoading || deleteFileLoading}
|
||||||
|
options={[
|
||||||
|
{ name: "planName", label: "应急预案名称" },
|
||||||
|
{ name: "planCode", label: "预案编码" },
|
||||||
|
{
|
||||||
|
name: "applicableField",
|
||||||
|
label: "适应领域",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="emergencyPlanApplicableField"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("applicableFieldName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "applicableFieldName", label: "适应领域名称", onlyForLabel: true },
|
||||||
|
{
|
||||||
|
name: "planCategory",
|
||||||
|
label: "预案类别",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="emergencyPlanCategory"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("planCategoryName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "planCategoryName", label: "预案类别名称", onlyForLabel: true },
|
||||||
|
{
|
||||||
|
name: "planType",
|
||||||
|
label: "预案级别",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="emergencyPlanType"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("planTypeName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "planTypeName", label: "预案级别名称", onlyForLabel: true },
|
||||||
|
{ name: "draftingUnit", label: "编制单位" },
|
||||||
|
{ name: "draftingPerson", label: "编制人" },
|
||||||
|
{ name: "releaseDate", label: "发布日期", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||||
|
{ name: "releaseNumber", label: "发布文号" },
|
||||||
|
{ name: "releaseUnit", label: "发布单位" },
|
||||||
|
{ name: "signatory", label: "签发人" },
|
||||||
|
{
|
||||||
|
name: "recordStatus",
|
||||||
|
label: "备案状态",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||||
|
items: EMERGENCY_PLAN_FILING_STATUS_ENUM,
|
||||||
|
componentProps: {
|
||||||
|
onChange: (value) => {
|
||||||
|
form.setFieldValue("recordStatusName", getLabelName({
|
||||||
|
list: EMERGENCY_PLAN_FILING_STATUS_ENUM,
|
||||||
|
status: value,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ name: "recordStatusName", label: "备案状态名称", onlyForLabel: true },
|
||||||
|
{ name: "recordTime", label: "备案时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||||
|
{ name: "recordReceivingUnit", label: "备案接收单位" },
|
||||||
|
{ name: "planSummary", label: "预案摘要", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24 },
|
||||||
|
{ name: "remarks", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, span: 24, required: false },
|
||||||
|
{
|
||||||
|
name: "files",
|
||||||
|
label: "相关附件",
|
||||||
|
render: (
|
||||||
|
<Upload
|
||||||
|
maxCount={1}
|
||||||
|
size={20}
|
||||||
|
fileType="document"
|
||||||
|
accept=".pdf,.png,.jpg"
|
||||||
|
onGetRemoveFile={(file) => {
|
||||||
|
form.setFieldValue("deleteFiles", [...(form.getFieldValue("deleteFiles") || []), file]);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
required: false,
|
||||||
|
span: 24,
|
||||||
|
},
|
||||||
|
{ name: "deleteFiles", label: "删除的附件", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_PLAN], true)(Add);
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||||
|
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 useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_EMERGENCY_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function List(props) {
|
||||||
|
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||||
|
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["emergencyPlanList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.planName}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyPlanDelete"]({ id: record.id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteBatch = () => {
|
||||||
|
if (selectedRowKeys.length === 0) {
|
||||||
|
message.warning("请选择要删除的记录");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确认要删除吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["emergencyPlanDeleteBatch"]({ ids: selectedRowKeys });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "likePlanName", label: "应急预案名称" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
rowSelection={{
|
||||||
|
preserveSelectedRowKeys: true,
|
||||||
|
selectedRowKeys,
|
||||||
|
onChange: (selectedRowKeys) => {
|
||||||
|
setSelectedRowKeys(selectedRowKeys);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push("./add");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
ghost
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
onClick={onDeleteBatch}
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "应急预案名称", dataIndex: "planName" },
|
||||||
|
{ title: "预案类别", dataIndex: "planCategoryName" },
|
||||||
|
{ title: "预案级别", dataIndex: "planTypeName" },
|
||||||
|
{ title: "备案状态", dataIndex: "recordStatusName" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./view?id=${record.id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./add?id=${record.id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_PLAN], true)(List);
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Descriptions, Spin } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||||
|
import PreviewPdf from "zy-react-library/components/PreviewPdf";
|
||||||
|
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||||
|
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import { getFileSuffix } from "zy-react-library/utils";
|
||||||
|
import { NS_EMERGENCY_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function View(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
|
||||||
|
const [info, setInfo] = useState({});
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["emergencyPlanInfo"]({ id: query.id });
|
||||||
|
const files = [];
|
||||||
|
if (data.fileId) {
|
||||||
|
const fileItems = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[703], eqForeignKey: data.fileId });
|
||||||
|
files.push(...fileItems);
|
||||||
|
}
|
||||||
|
setInfo({
|
||||||
|
...data,
|
||||||
|
files,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const previewFile = (files = []) => {
|
||||||
|
const pdfFile = [];
|
||||||
|
const imgFile = [];
|
||||||
|
for (let i = 0; i < files.length; i++) {
|
||||||
|
const file = files[i];
|
||||||
|
if (getFileSuffix(file.fileName) === "pdf")
|
||||||
|
pdfFile.push(file);
|
||||||
|
else
|
||||||
|
imgFile.push(file);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PreviewPdf files={pdfFile} />
|
||||||
|
<PreviewImg files={imgFile} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page headerTitle="查看">
|
||||||
|
<Spin spinning={props.emergencyPlan.emergencyPlanLoading || getFileLoading}>
|
||||||
|
<Descriptions
|
||||||
|
bordered
|
||||||
|
column={2}
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "应急预案名称", children: info.planName },
|
||||||
|
{ label: "预案编码", children: info.planCode },
|
||||||
|
{ label: "适应领域", children: info.applicableFieldName },
|
||||||
|
{ label: "预案类别", children: info.planCategoryName },
|
||||||
|
{ label: "预案级别", children: info.planTypeName },
|
||||||
|
{ label: "编制单位", children: info.draftingUnit },
|
||||||
|
{ label: "编制人", children: info.draftingPerson },
|
||||||
|
{ label: "发布日期", children: info.releaseDate },
|
||||||
|
{ label: "发布文号", children: info.releaseNumber },
|
||||||
|
{ label: "发布单位", children: info.releaseUnit },
|
||||||
|
{ label: "签发人", children: info.signatory },
|
||||||
|
{ label: "备案状态", children: info.recordStatusName },
|
||||||
|
{ label: "备案时间", children: info.recordTime },
|
||||||
|
{ label: "备案接收单位", children: info.recordReceivingUnit },
|
||||||
|
{ label: "预案摘要", children: info.planSummary, span: 2 },
|
||||||
|
{ label: "备注", children: info.remarks, span: 2 },
|
||||||
|
{ label: "附件", children: previewFile(info.files), span: 2 },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_EMERGENCY_PLAN], true)(View);
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function EmergencyPlan(props) {
|
||||||
|
return props.children;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EmergencyPlan;
|
||||||
|
|
@ -0,0 +1,128 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { message } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import Map from "zy-react-library/components/Map";
|
||||||
|
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useDictionary from "zy-react-library/hooks/useDictionary";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function BasicInfo(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const { getDictionary } = useDictionary();
|
||||||
|
|
||||||
|
const [enterprisePlanEventType, setEnterprisePlanEventType] = useState([]);
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.planId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanBasicInfoInfo"]({ id: props.planId });
|
||||||
|
form.setFieldsValue({
|
||||||
|
...data,
|
||||||
|
eventType: data.eventType ? data.eventType.split(",") : [],
|
||||||
|
eventTypeName: data.eventTypeName ? data.eventTypeName.split(",") : [],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const getEnterprisePlanEventType = async () => {
|
||||||
|
const dictionaryItems = await getDictionary({ dictValue: "enterprisePlanEventType" });
|
||||||
|
setEnterprisePlanEventType(dictionaryItems);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, [props.planId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getEnterprisePlanEventType();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success, data } = await props[!props.planId ? "enterprisePlanBasicInfoAdd" : "enterprisePlanBasicInfoUpdate"]({
|
||||||
|
...values,
|
||||||
|
eventType: values.eventType.join(","),
|
||||||
|
eventTypeName: values.eventTypeName.join(","),
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.setUrlState({
|
||||||
|
planId: data?.id || props.planId,
|
||||||
|
planName: values.planName,
|
||||||
|
currentStep: "gradeResponse",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanBasicInfoLoading}
|
||||||
|
submitButtonText="保存并下一步"
|
||||||
|
options={[
|
||||||
|
{ name: "planName", label: "预案名称" },
|
||||||
|
{
|
||||||
|
name: "planType",
|
||||||
|
label: "预案类型",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="enterprisePlanType"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("planTypeName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "planTypeName", label: "预案类型名称", onlyForLabel: true },
|
||||||
|
{ name: "planCode", label: "预案编码" },
|
||||||
|
{
|
||||||
|
name: "planLevel",
|
||||||
|
label: "预案等级",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="enterprisePlanLevel"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("planLevelName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "planLevelName", label: "预案等级名称", onlyForLabel: true },
|
||||||
|
{
|
||||||
|
name: "eventType",
|
||||||
|
label: "事件类型",
|
||||||
|
span: 24,
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.CHECKBOX,
|
||||||
|
items: enterprisePlanEventType,
|
||||||
|
itemsField: { valueKey: "dictValue", labelKey: "dictLabel" },
|
||||||
|
componentProps: {
|
||||||
|
onChange: (value) => {
|
||||||
|
const eventTypeName = [];
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
eventTypeName.push(getLabelName({
|
||||||
|
list: enterprisePlanEventType,
|
||||||
|
status: value[i],
|
||||||
|
nameKey: "dictLabel",
|
||||||
|
idKey: "dictValue",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
form.setFieldValue("eventTypeName", eventTypeName);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ name: "eventTypeName", label: "事件类型名称", onlyForLabel: true },
|
||||||
|
{ key: "map", customizeRender: true, span: 24, render: (<Map type="cesium" />) },
|
||||||
|
{ name: "planOverview", label: "预案概述", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
{ name: "remarks", label: "备注", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(BasicInfo);
|
||||||
|
|
@ -0,0 +1,161 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function GradeResponse(props) {
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanLevelResponseList"], {
|
||||||
|
params: {
|
||||||
|
likePlanId: props.planId,
|
||||||
|
},
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
onSuccess: () => {
|
||||||
|
props.setResponseLevelRefresh(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (id) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确定要删除吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanLevelResponseDelete"]({ id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "分级名称", dataIndex: "levelName" },
|
||||||
|
{ title: "分级描述", dataIndex: "levelDescription" },
|
||||||
|
{ title: "备注信息", dataIndex: "remarks" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId(record.id);
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
options={false}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
id={currentId}
|
||||||
|
planId={props.planId}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanLevelResponseInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "enterprisePlanLevelResponseAdd" : "enterprisePlanLevelResponseUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
planId: props.planId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanLevelResponseLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanLevelResponseLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
options={[
|
||||||
|
{ name: "levelName", label: "分级名称" },
|
||||||
|
{ name: "levelDescription", label: "分级描述", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
{ name: "remarks", label: "备注信息", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(GradeResponse);
|
||||||
|
|
@ -0,0 +1,366 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space, Tag } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
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 Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { PHONE } from "zy-react-library/regular";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
const defaultParentId = 0;
|
||||||
|
const defaultParentName = "(无)此项为顶级分组";
|
||||||
|
const addModalTypeNames = {
|
||||||
|
add: "新增",
|
||||||
|
update: "编辑",
|
||||||
|
addChild: "添加下级",
|
||||||
|
};
|
||||||
|
|
||||||
|
function OrganizationStructure(props) {
|
||||||
|
const [treeList, setTreeList] = useState([]);
|
||||||
|
|
||||||
|
const [parentId, setParentId] = useState(defaultParentId);
|
||||||
|
const [parentName, setParentName] = useState(defaultParentName);
|
||||||
|
const [currentOrganization, setCurrentOrganization] = useState({});
|
||||||
|
const [currentOrganizationId, setCurrentOrganizationId] = useState("");
|
||||||
|
const [addOrganizationModalVisible, setAddOrganizationModalVisible] = useState(false);
|
||||||
|
const [addOrganizationModalType, setAddOrganizationModalType] = useState("");
|
||||||
|
|
||||||
|
const [currentOrganizationPersonnelId, setCurrentOrganizationPersonnelId] = useState("");
|
||||||
|
const [addOrganizationPersonnelModalVisible, setAddOrganizationPersonnelModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanOrganizationPersonnelList"], {
|
||||||
|
params: { planId: props.planId, organizationId: currentOrganization.id },
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
manual: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getTreeList = async () => {
|
||||||
|
const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
|
||||||
|
setTreeList(data);
|
||||||
|
props.setExecutingAgencyRefresh(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getTreeList();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onDeleteOrganization = () => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确定要删除该组织吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanLevelOrganizationDelete"]({ id: currentOrganization.id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getTreeList();
|
||||||
|
setCurrentOrganization({});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteOrganizationPersonnel = (id) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确定要删除该人员吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanOrganizationPersonnelDelete"]({ id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div style={{ display: "flex" }}>
|
||||||
|
<div style={{ width: 500 }}>
|
||||||
|
<Space style={{ marginBottom: 16 }}>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddOrganizationModalVisible(true);
|
||||||
|
setAddOrganizationModalType("add");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增一级
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
disabled={Object.keys(currentOrganization).length === 0}
|
||||||
|
onClick={() => {
|
||||||
|
setAddOrganizationModalVisible(true);
|
||||||
|
setAddOrganizationModalType("addChild");
|
||||||
|
setParentId(currentOrganization.id);
|
||||||
|
setParentName(currentOrganization.orgName);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增下级
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<EditIcon />)}
|
||||||
|
disabled={Object.keys(currentOrganization).length === 0}
|
||||||
|
onClick={() => {
|
||||||
|
setAddOrganizationModalVisible(true);
|
||||||
|
setAddOrganizationModalType("update");
|
||||||
|
setParentId(currentOrganization.parentId);
|
||||||
|
setParentName(currentOrganization.parentName);
|
||||||
|
setCurrentOrganizationId(currentOrganization.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
danger
|
||||||
|
icon={(<DeleteIcon />)}
|
||||||
|
disabled={Object.keys(currentOrganization).length === 0 || currentOrganization.children || tableProps.dataSource.length > 0}
|
||||||
|
onClick={onDeleteOrganization}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
<BasicLeftTree
|
||||||
|
treeData={treeList}
|
||||||
|
nameKey="orgName"
|
||||||
|
onGetNodePaths={(nodes) => {
|
||||||
|
const currentNode = nodes.at(-1);
|
||||||
|
setCurrentOrganization(currentNode);
|
||||||
|
getData();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style={{ flex: 1 }}>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
disabled={Object.keys(currentOrganization).length === 0}
|
||||||
|
onClick={() => {
|
||||||
|
setAddOrganizationPersonnelModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增人员
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "姓名", dataIndex: "userName" },
|
||||||
|
{ title: "职务", dataIndex: "position" },
|
||||||
|
{ title: "组内岗位", dataIndex: "groupPost" },
|
||||||
|
{ title: "联系电话", dataIndex: "contactPhone" },
|
||||||
|
{ title: "紧急联系电话", dataIndex: "emergencyContactPhone" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentOrganizationPersonnelId(record.id);
|
||||||
|
setAddOrganizationPersonnelModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDeleteOrganizationPersonnel(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
addOrganizationModalVisible && (
|
||||||
|
<AddOrganizationModal
|
||||||
|
onCancel={() => {
|
||||||
|
setAddOrganizationModalVisible(false);
|
||||||
|
setParentId(defaultParentId);
|
||||||
|
setParentName(defaultParentName);
|
||||||
|
setCurrentOrganizationId("");
|
||||||
|
setAddOrganizationModalType("");
|
||||||
|
}}
|
||||||
|
id={currentOrganizationId}
|
||||||
|
planId={props.planId}
|
||||||
|
getData={getTreeList}
|
||||||
|
parentId={parentId}
|
||||||
|
parentName={parentName}
|
||||||
|
addModalType={addOrganizationModalType}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
addOrganizationPersonnelModalVisible && (
|
||||||
|
<AddOrganizationPersonnelModal
|
||||||
|
onCancel={() => {
|
||||||
|
setAddOrganizationPersonnelModalVisible(false);
|
||||||
|
setCurrentOrganizationPersonnelId("");
|
||||||
|
}}
|
||||||
|
id={currentOrganizationPersonnelId}
|
||||||
|
organizationId={currentOrganization.id}
|
||||||
|
organizationName={currentOrganization.orgName}
|
||||||
|
planId={props.planId}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddOrganizationModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanLevelOrganizationInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "enterprisePlanLevelOrganizationAdd" : "enterprisePlanLevelOrganizationUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
planId: props.planId,
|
||||||
|
parentId: props.parentId,
|
||||||
|
parentName: props.parentName,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${addModalTypeNames[props.addModalType]}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={addModalTypeNames[props.addModalType]}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanLevelOrganizationLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanLevelOrganizationLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 10 }}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
key: "parentName",
|
||||||
|
label: "上级菜单",
|
||||||
|
render: (<Tag color="#4096ff">{props.addModalType === "add" ? defaultParentName : props.parentName}</Tag>),
|
||||||
|
},
|
||||||
|
{ name: "orgName", label: "名称" },
|
||||||
|
{ name: "orgNameEn", label: "英文名称" },
|
||||||
|
{ name: "orgCode", label: "编码" },
|
||||||
|
{ name: "leaderName", label: "负责人" },
|
||||||
|
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||||
|
{ name: "departmentFunction", label: "部门职能", required: false },
|
||||||
|
{ name: "address", label: "地址", required: false },
|
||||||
|
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddOrganizationPersonnelModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanOrganizationPersonnelInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "enterprisePlanOrganizationPersonnelAdd" : "enterprisePlanOrganizationPersonnelUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
planId: props.planId,
|
||||||
|
organizationId: props.organizationId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${props.id ? "编辑" : "添加"}成功`);
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanOrganizationPersonnelLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanOrganizationPersonnelLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 10 }}
|
||||||
|
options={[
|
||||||
|
{
|
||||||
|
key: "organizationName",
|
||||||
|
label: "所属机构",
|
||||||
|
render: (<Tag color="#4096ff">{props.organizationName}</Tag>),
|
||||||
|
},
|
||||||
|
{ name: "userName", label: "姓名" },
|
||||||
|
{ name: "position", label: "职务" },
|
||||||
|
{ name: "groupPost", label: "组内岗位", required: false },
|
||||||
|
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||||
|
{ name: "emergencyContactPhone", label: "紧急联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddOrganizationModal = Connect([NS_ENTERPRISE_PLAN], true)(AddOrganizationModalComponent);
|
||||||
|
const AddOrganizationPersonnelModal = Connect([NS_ENTERPRISE_PLAN], true)(AddOrganizationPersonnelModalComponent);
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(OrganizationStructure);
|
||||||
|
|
@ -0,0 +1,226 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space } from "antd";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import Upload from "zy-react-library/components/Upload";
|
||||||
|
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||||
|
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||||
|
import useDownloadFile from "zy-react-library/hooks/useDownloadFile";
|
||||||
|
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function PlanAttachments(props) {
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
const { loading: downloadFileLoading, downloadFile } = useDownloadFile();
|
||||||
|
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanAttachmentList"], {
|
||||||
|
params: {
|
||||||
|
likePlanId: props.planId,
|
||||||
|
},
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (id) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确定要删除吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanAttachmentDelete"]({ id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "文件名称", dataIndex: "fileName" },
|
||||||
|
{ title: "附件类型", dataIndex: "attachmentTypeName" },
|
||||||
|
{ title: "备注", dataIndex: "remarks" },
|
||||||
|
{
|
||||||
|
title: "维护日期",
|
||||||
|
dataIndex: "createTime",
|
||||||
|
render: (_, record) => dayjs(record.updateTime || record.createTime).format("YYYY-MM-DD HH:mm:ss"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={async () => {
|
||||||
|
const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[702], eqForeignKey: record.fileId });
|
||||||
|
downloadFile({ url: files[0].url, name: files[0].name });
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
下载
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId(record.id);
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
loading={tableProps.loading || getFileLoading || downloadFileLoading}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
id={currentId}
|
||||||
|
planId={props.planId}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
const { loading: getFileLoading, getFile } = useGetFile();
|
||||||
|
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||||
|
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||||
|
|
||||||
|
const fileIdRef = useRef("");
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanAttachmentInfo"]({ id: props.id });
|
||||||
|
fileIdRef.current = data.fileId;
|
||||||
|
const files = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM[702], eqForeignKey: data.fileId });
|
||||||
|
form.setFieldsValue({
|
||||||
|
...data,
|
||||||
|
files,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
await deleteFile({ single: false, files: values.deleteFiles });
|
||||||
|
const { id: fileId } = await uploadFile({
|
||||||
|
single: false,
|
||||||
|
files: values.files,
|
||||||
|
params: { type: UPLOAD_FILE_TYPE_ENUM[702], foreignKey: fileIdRef.current },
|
||||||
|
});
|
||||||
|
const { success } = await props[!props.id ? "enterprisePlanAttachmentAdd" : "enterprisePlanAttachmentUpdate"]({
|
||||||
|
...values,
|
||||||
|
fileId,
|
||||||
|
id: props.id,
|
||||||
|
planId: props.planId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={800}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanAttachmentLoading || uploadFileLoading || deleteFileLoading || getFileLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanAttachmentLoading || uploadFileLoading || deleteFileLoading || getFileLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 6 }}
|
||||||
|
options={[
|
||||||
|
{ name: "fileName", label: "文件名称" },
|
||||||
|
{
|
||||||
|
name: "attachmentType",
|
||||||
|
label: "附件类型",
|
||||||
|
render: (
|
||||||
|
<DictionarySelect
|
||||||
|
dictValue="enterprisePlanFileType"
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("attachmentTypeName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "attachmentTypeName", label: "附件类型名称", onlyForLabel: true },
|
||||||
|
{ name: "remarks", label: "备注", required: false },
|
||||||
|
{
|
||||||
|
name: "files",
|
||||||
|
label: "附件",
|
||||||
|
render: (
|
||||||
|
<Upload
|
||||||
|
maxCount={1}
|
||||||
|
accept=".pdf"
|
||||||
|
onGetRemoveFile={(file) => {
|
||||||
|
form.setFieldValue("deleteFiles", [...(form.getFieldValue("deleteFiles") || []), file]);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "deleteFiles", label: "删除的附件", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(PlanAttachments);
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Divider, message, Modal, Space } from "antd";
|
||||||
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import BasicSelectTree from "zy-react-library/components/SelectTree/Basic";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function PlanInstructions(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const [responseLevelList, setResponseLevelList] = useState([]);
|
||||||
|
const [executingAgencyListTree, setExecutingAgencyListTree] = useState([]);
|
||||||
|
const isEditCommandIdRef = useRef("");
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanCommandSettingList"], {
|
||||||
|
params: {
|
||||||
|
likePlanId: props.planId,
|
||||||
|
},
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getResponseLevelList = async () => {
|
||||||
|
if (!props.responseLevelRefresh)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanLevelResponseListAll"]({ planId: props.planId });
|
||||||
|
setResponseLevelList(data);
|
||||||
|
props.setResponseLevelRefresh(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTreeList = async () => {
|
||||||
|
if (!props.executingAgencyRefresh)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanLevelOrganizationListTree"]({ planId: props.planId });
|
||||||
|
setExecutingAgencyListTree(data);
|
||||||
|
props.setExecutingAgencyRefresh(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getTreeList();
|
||||||
|
}, [props.executingAgencyRefresh]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getResponseLevelList();
|
||||||
|
}, [props.responseLevelRefresh]);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!isEditCommandIdRef.current ? "enterprisePlanCommandSettingAdd" : "enterprisePlanCommandSettingUpdate"]({
|
||||||
|
...values,
|
||||||
|
responseLevel: values.responseLevel.join(","),
|
||||||
|
responseLevelName: values.responseLevelName.join(","),
|
||||||
|
executingAgencyId: values.executingAgencyId.join(","),
|
||||||
|
executingAgencyName: values.executingAgencyName.join(","),
|
||||||
|
planId: props.planId,
|
||||||
|
id: isEditCommandIdRef.current,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success(`${isEditCommandIdRef.current ? "编辑" : "添加"}成功`);
|
||||||
|
form.resetFields();
|
||||||
|
getData();
|
||||||
|
isEditCommandIdRef.current = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDelete = (id) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除指令",
|
||||||
|
content: "确定要删除该指令吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanCommandSettingDelete"]({ id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
form.resetFields();
|
||||||
|
getData();
|
||||||
|
isEditCommandIdRef.current = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ display: "flex" }}>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<FormBuilder
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 6 }}
|
||||||
|
loading={props.enterprisePlan.enterprisePlanCommandSettingLoading}
|
||||||
|
options={[
|
||||||
|
{ key: "divider", label: "指令设置", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||||
|
{
|
||||||
|
name: "responseLevel",
|
||||||
|
label: "响应级别",
|
||||||
|
render: FORM_ITEM_RENDER_ENUM.CHECKBOX,
|
||||||
|
items: responseLevelList,
|
||||||
|
itemsField: { labelKey: "levelName", valueKey: "id" },
|
||||||
|
componentProps: {
|
||||||
|
onChange: (values) => {
|
||||||
|
const responseLevelName = [];
|
||||||
|
for (let i = 0; i < values.length; i++) {
|
||||||
|
responseLevelName.push(getLabelName({
|
||||||
|
list: responseLevelList,
|
||||||
|
status: values[i],
|
||||||
|
idKey: "id",
|
||||||
|
nameKey: "levelName",
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
form.setFieldValue("responseLevelName", responseLevelName);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ name: "responseLevelName", label: "响应级别名称", onlyForLabel: true },
|
||||||
|
{ name: "commandContent", label: "指令内容", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||||
|
{
|
||||||
|
name: "executingAgencyId",
|
||||||
|
label: "执行机构",
|
||||||
|
render: (
|
||||||
|
<BasicSelectTree
|
||||||
|
treeData={executingAgencyListTree}
|
||||||
|
nameKey="orgName"
|
||||||
|
multiple
|
||||||
|
onGetLabel={(label) => {
|
||||||
|
form.setFieldValue("executingAgencyName", label);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{ name: "executingAgencyName", label: "执行机构名称", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
<Space style={{ justifyContent: "center", width: "100%" }}>
|
||||||
|
<Button
|
||||||
|
loading={props.enterprisePlan.enterprisePlanCommandSettingLoading}
|
||||||
|
type="primary"
|
||||||
|
onClick={() => {
|
||||||
|
form.submit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
<Button onClick={() => {
|
||||||
|
form.resetFields();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
<div style={{ width: "50%" }}>
|
||||||
|
<Divider orientation="left">指令列表</Divider>
|
||||||
|
<Table
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
{ title: "响应级别", dataIndex: "responseLevelName" },
|
||||||
|
{ title: "指令内容", dataIndex: "commandContent" },
|
||||||
|
{ title: "执行机构", dataIndex: "executingAgencyName" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={async () => {
|
||||||
|
const { data } = await props["enterprisePlanCommandSettingInfo"]({ id: record.id });
|
||||||
|
isEditCommandIdRef.current = record.id;
|
||||||
|
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(",") : [],
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(PlanInstructions);
|
||||||
|
|
@ -0,0 +1,237 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, Descriptions, message, Modal, Space } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
|
import Map from "zy-react-library/components/Map";
|
||||||
|
import Table from "zy-react-library/components/Table";
|
||||||
|
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { PHONE } from "zy-react-library/regular";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function GradeResponse(props) {
|
||||||
|
const [addModalVisible, setAddModalVisible] = useState(false);
|
||||||
|
const [viewModalVisible, setViewModalVisible] = useState(false);
|
||||||
|
const [currentId, setCurrentId] = useState("");
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanResourceList"], {
|
||||||
|
params: {
|
||||||
|
likePlanId: props.planId,
|
||||||
|
},
|
||||||
|
useStorageQueryCriteria: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (id) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: "确定要删除吗?",
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanResourceDelete"]({ id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "资源类型", dataIndex: "resourceType" },
|
||||||
|
{ title: "资源名称", dataIndex: "resourceName" },
|
||||||
|
{ title: "资源地址", dataIndex: "resourceAddress" },
|
||||||
|
{ title: "资源数量", dataIndex: "resourceQuantity" },
|
||||||
|
{ title: "联系人", dataIndex: "contactPerson" },
|
||||||
|
{ title: "电话", dataIndex: "contactPhone" },
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId(record.id);
|
||||||
|
setViewModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
setCurrentId(record.id);
|
||||||
|
setAddModalVisible(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
options={false}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
addModalVisible && (
|
||||||
|
<AddModal
|
||||||
|
onCancel={() => {
|
||||||
|
setAddModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
id={currentId}
|
||||||
|
planId={props.planId}
|
||||||
|
getData={getData}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
viewModalVisible && (
|
||||||
|
<ViewModal
|
||||||
|
onCancel={() => {
|
||||||
|
setViewModalVisible(false);
|
||||||
|
setCurrentId("");
|
||||||
|
}}
|
||||||
|
id={currentId}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const AddModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
if (!props.id)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const { data } = await props["enterprisePlanResourceInfo"]({ id: props.id });
|
||||||
|
form.setFieldsValue(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props[!props.id ? "enterprisePlanResourceAdd" : "enterprisePlanResourceUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.id,
|
||||||
|
planId: props.planId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("操作成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.getData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title={props.id ? "编辑" : "新增"}
|
||||||
|
width={800}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanResourceLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanResourceLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 6 }}
|
||||||
|
options={[
|
||||||
|
{ name: "resourceType", label: "资源类型" },
|
||||||
|
{ name: "resourceName", label: "资源名称" },
|
||||||
|
{ name: "resourceAddress", label: "资源地址" },
|
||||||
|
{ name: "resourceQuantity", label: "资源数量", render: FORM_ITEM_RENDER_ENUM.INTEGER },
|
||||||
|
{ name: "contactPerson", label: "联系人" },
|
||||||
|
{ name: "contactPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的电话号码" }] },
|
||||||
|
{ name: "resourceDescription", label: "资源描述" },
|
||||||
|
{ name: "remarks", label: "备注", required: false },
|
||||||
|
{ key: "map", customizeRender: true, render: (<Map type="cesium" required={false} />) },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ViewModalComponent = (props) => {
|
||||||
|
const [info, setInfo] = useState({});
|
||||||
|
|
||||||
|
const getData = async () => {
|
||||||
|
const { data } = await props["enterprisePlanResourceInfo"]({ id: props.id });
|
||||||
|
setInfo(data);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
getData();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title="查看"
|
||||||
|
width={800}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
footer={[
|
||||||
|
<Button key="cancel" onClick={props.onCancel}>取消</Button>,
|
||||||
|
]}
|
||||||
|
loading={props.enterprisePlan.enterprisePlanResourceLoading}
|
||||||
|
>
|
||||||
|
<Descriptions
|
||||||
|
column={1}
|
||||||
|
bordered
|
||||||
|
styles={{ label: { width: 200 } }}
|
||||||
|
items={[
|
||||||
|
{ label: "资源类型", children: info.resourceType },
|
||||||
|
{ label: "资源名称", children: info.resourceName },
|
||||||
|
{ label: "资源地址", children: info.resourceAddress },
|
||||||
|
{ label: "资源数量", children: info.resourceQuantity },
|
||||||
|
{ label: "联系人", children: info.contactPerson },
|
||||||
|
{ label: "联系电话", children: info.contactPhone },
|
||||||
|
{ label: "资源描述", children: info.resourceDescription },
|
||||||
|
{ label: "备注", children: info.remarks },
|
||||||
|
{ label: "经度", children: info.longitude },
|
||||||
|
{ label: "纬度", children: info.latitude },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const AddModal = Connect([NS_ENTERPRISE_PLAN], true)(AddModalComponent);
|
||||||
|
const ViewModal = Connect([NS_ENTERPRISE_PLAN], true)(ViewModalComponent);
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(GradeResponse);
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { message } from "antd";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
|
function PlanText(props) {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props["enterprisePlanBasicInfoUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.planId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.setUrlState({ currentStep: "planAttachments" });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanBasicInfoLoading}
|
||||||
|
values={{
|
||||||
|
planName: props.planName,
|
||||||
|
}}
|
||||||
|
submitButtonText="保存并下一步"
|
||||||
|
options={[
|
||||||
|
{ name: "planName", label: "预案名称", span: 24, componentProps: { disabled: true } },
|
||||||
|
{ name: "planText", label: "预案文本", span: 24, render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Connect([NS_ENTERPRISE_PLAN], true)(PlanText);
|
||||||
|
|
@ -0,0 +1,245 @@
|
||||||
|
import useUrlState from "@ahooksjs/use-url-state";
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space, Tabs } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||||
|
import Page from "zy-react-library/components/Page";
|
||||||
|
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||||
|
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||||
|
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
import BasicInfo from "./components/BasicInfo";
|
||||||
|
import GradeResponse from "./components/GradeResponse";
|
||||||
|
import OrganizationStructure from "./components/OrganizationStructure";
|
||||||
|
import PlanAttachments from "./components/PlanAttachments";
|
||||||
|
import PlanInstructions from "./components/PlanInstructions";
|
||||||
|
import PlanResources from "./components/PlanResources";
|
||||||
|
import PlanText from "./components/PlanText";
|
||||||
|
|
||||||
|
function Add(props) {
|
||||||
|
const query = useGetUrlQuery();
|
||||||
|
const [urlState, setUrlState] = useUrlState(
|
||||||
|
{
|
||||||
|
currentStep: "basicInfo",
|
||||||
|
planId: query.id,
|
||||||
|
planName: query.planName,
|
||||||
|
},
|
||||||
|
{ navigateMode: "replace" },
|
||||||
|
);
|
||||||
|
|
||||||
|
const [responseLevelRefresh, setResponseLevelRefresh] = useState(true);
|
||||||
|
const [executingAgencyRefresh, setExecutingAgencyRefresh] = useState(true);
|
||||||
|
const [reviewPersonModalVisible, setReviewPersonModalVisible] = useState(false);
|
||||||
|
|
||||||
|
const subordinateTabDisabled = !urlState.planId;
|
||||||
|
const isShowFooter = ["basicInfo", "planText"].includes(urlState.currentStep);
|
||||||
|
|
||||||
|
const previousStep = () => {
|
||||||
|
const stepMapping = {
|
||||||
|
gradeResponse: "basicInfo",
|
||||||
|
organizationStructure: "gradeResponse",
|
||||||
|
planResources: "organizationStructure",
|
||||||
|
planInstructions: "planResources",
|
||||||
|
planText: "planInstructions",
|
||||||
|
planAttachments: "planText",
|
||||||
|
};
|
||||||
|
|
||||||
|
const prevStep = stepMapping[urlState.currentStep];
|
||||||
|
if (prevStep)
|
||||||
|
setUrlState({ currentStep: prevStep });
|
||||||
|
};
|
||||||
|
|
||||||
|
const nextStep = () => {
|
||||||
|
const stepFlow = {
|
||||||
|
gradeResponse: "organizationStructure",
|
||||||
|
organizationStructure: "planResources",
|
||||||
|
planResources: "planInstructions",
|
||||||
|
planInstructions: "planText",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (urlState.currentStep === "planText") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (urlState.currentStep === "planAttachments") {
|
||||||
|
setReviewPersonModalVisible(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextStep = stepFlow[urlState.currentStep];
|
||||||
|
if (nextStep) {
|
||||||
|
setUrlState({ currentStep: nextStep });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page
|
||||||
|
headerTitle={query.id ? "编辑" : "新增"}
|
||||||
|
isShowFooter={!isShowFooter}
|
||||||
|
customActionButtons={(
|
||||||
|
<Space>
|
||||||
|
<Button onClick={previousStep}>上一步</Button>
|
||||||
|
<Button type="primary" onClick={nextStep}>
|
||||||
|
{urlState.currentStep === "planAttachments" ? "提交审核" : "下一步"}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Tabs
|
||||||
|
activeKey={urlState.currentStep}
|
||||||
|
onChange={key => setUrlState({ currentStep: key })}
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
key: "basicInfo",
|
||||||
|
label: "基本信息",
|
||||||
|
children: (
|
||||||
|
<BasicInfo
|
||||||
|
planId={urlState.planId}
|
||||||
|
setUrlState={setUrlState}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "gradeResponse",
|
||||||
|
label: "分级响应",
|
||||||
|
children: (
|
||||||
|
<GradeResponse
|
||||||
|
planId={urlState.planId}
|
||||||
|
setResponseLevelRefresh={setResponseLevelRefresh}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "organizationStructure",
|
||||||
|
label: "组织结构",
|
||||||
|
children: (
|
||||||
|
<OrganizationStructure
|
||||||
|
planId={urlState.planId}
|
||||||
|
setExecutingAgencyRefresh={setExecutingAgencyRefresh}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planResources",
|
||||||
|
label: "预案资源",
|
||||||
|
children: (<PlanResources planId={urlState.planId} />),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planInstructions",
|
||||||
|
label: "预案指令",
|
||||||
|
children: (
|
||||||
|
<PlanInstructions
|
||||||
|
planId={urlState.planId}
|
||||||
|
setResponseLevelRefresh={setResponseLevelRefresh}
|
||||||
|
setExecutingAgencyRefresh={setExecutingAgencyRefresh}
|
||||||
|
responseLevelRefresh={responseLevelRefresh}
|
||||||
|
executingAgencyRefresh={executingAgencyRefresh}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planText",
|
||||||
|
label: "预案文案",
|
||||||
|
children: (
|
||||||
|
<PlanText
|
||||||
|
planId={urlState.planId}
|
||||||
|
planName={urlState.planName}
|
||||||
|
setUrlState={setUrlState}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "planAttachments",
|
||||||
|
label: "预案附件",
|
||||||
|
children: (<PlanAttachments planId={urlState.planId} />),
|
||||||
|
disabled: subordinateTabDisabled,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
{
|
||||||
|
reviewPersonModalVisible && (
|
||||||
|
<ReviewPersonModal
|
||||||
|
onCancel={() => setReviewPersonModalVisible(false)}
|
||||||
|
planId={urlState.planId}
|
||||||
|
goBack={props.history.goBack}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const ReviewPersonModalComponent = (props) => {
|
||||||
|
const [form] = FormBuilder.useForm();
|
||||||
|
|
||||||
|
const [userInfo, setUserInfo] = useState({});
|
||||||
|
|
||||||
|
const { getUserInfo } = useGetUserInfo();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
(async () => {
|
||||||
|
const userInfo = await getUserInfo();
|
||||||
|
setUserInfo(userInfo);
|
||||||
|
})();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const onSubmit = async (values) => {
|
||||||
|
const { success } = await props["enterprisePlanBasicInfoUpdate"]({
|
||||||
|
...values,
|
||||||
|
id: props.planId,
|
||||||
|
});
|
||||||
|
if (success) {
|
||||||
|
message.success("保存成功");
|
||||||
|
props.onCancel();
|
||||||
|
props.goBack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
open
|
||||||
|
title="审核人员"
|
||||||
|
width={600}
|
||||||
|
maskClosable={false}
|
||||||
|
onCancel={props.onCancel}
|
||||||
|
onOk={form.submit}
|
||||||
|
confirmLoading={props.enterprisePlan.enterprisePlanBasicInfoLoading}
|
||||||
|
>
|
||||||
|
<FormBuilder
|
||||||
|
loading={props.enterprisePlan.enterprisePlanBasicInfoLoading}
|
||||||
|
showActionButtons={false}
|
||||||
|
span={24}
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
options={[
|
||||||
|
{ name: "auditUserId", label: "审核人员", render: (
|
||||||
|
<PersonnelSelect
|
||||||
|
params={{ departmentId: userInfo.departmentId }}
|
||||||
|
onGetOption={(option) => {
|
||||||
|
form.setFieldValue("auditUserName", option.name);
|
||||||
|
form.setFieldValue("auditCorpId", option.corpinfoId);
|
||||||
|
form.setFieldValue("auditCorpName", option.corpinfoName);
|
||||||
|
form.setFieldValue("auditDeptId", option.departmentId);
|
||||||
|
form.setFieldValue("auditDeptName", option.departmentName);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) },
|
||||||
|
{ name: "auditUserName", label: "审核人员名称", onlyForLabel: true },
|
||||||
|
{ name: "auditCorpId", label: "审核人企业ID", onlyForLabel: true },
|
||||||
|
{ name: "auditCorpName", label: "审核人企业名称", onlyForLabel: true },
|
||||||
|
{ name: "auditDeptId", label: "审核人部门ID", onlyForLabel: true },
|
||||||
|
{ name: "auditDeptName", label: "审核人部门名称", onlyForLabel: true },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={onSubmit}
|
||||||
|
/>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const ReviewPersonModal = Connect([NS_ENTERPRISE_PLAN], true)(ReviewPersonModalComponent);
|
||||||
|
export default Add;
|
||||||
|
|
@ -1,9 +1,111 @@
|
||||||
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
|
import { Button, message, Modal, Space } from "antd";
|
||||||
|
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||||
import Page from "zy-react-library/components/Page";
|
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 useTable from "zy-react-library/hooks/useTable";
|
||||||
|
import { getLabelName } from "zy-react-library/utils";
|
||||||
|
import { ENTERPRISE_PLAN_AUDIT_STATUS_ENUM } from "~/enumerate/constant";
|
||||||
|
import { NS_ENTERPRISE_PLAN } from "~/enumerate/namespace";
|
||||||
|
|
||||||
function List(props) {
|
function List(props) {
|
||||||
|
const [form] = Search.useForm();
|
||||||
|
|
||||||
|
const { tableProps, getData } = useTable(props["enterprisePlanBasicInfoList"], {
|
||||||
|
form,
|
||||||
|
});
|
||||||
|
|
||||||
|
const onDelete = (record) => {
|
||||||
|
Modal.confirm({
|
||||||
|
title: "删除确认",
|
||||||
|
content: `确定要删除【${record.planName}】吗`,
|
||||||
|
onOk: async () => {
|
||||||
|
const { success } = await props["enterprisePlanBasicInfoDelete"]({ id: record.id });
|
||||||
|
if (success) {
|
||||||
|
message.success("删除成功");
|
||||||
|
getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page isShowAllAction={false}></Page>
|
<Page isShowAllAction={false}>
|
||||||
|
<Search
|
||||||
|
options={[
|
||||||
|
{ name: "planName", label: "预案名称" },
|
||||||
|
]}
|
||||||
|
form={form}
|
||||||
|
onFinish={getData}
|
||||||
|
/>
|
||||||
|
<Table
|
||||||
|
toolBarRender={() => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
icon={(<AddIcon />)}
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push("./add");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
)}
|
||||||
|
columns={[
|
||||||
|
{ title: "预案名称", dataIndex: "planName" },
|
||||||
|
{ title: "预案编码", dataIndex: "planCode" },
|
||||||
|
{ title: "审核人", dataIndex: "auditUserName" },
|
||||||
|
{ title: "预案概述", dataIndex: "planOverview" },
|
||||||
|
{
|
||||||
|
title: "审核状态",
|
||||||
|
dataIndex: "auditFlag",
|
||||||
|
render: (_, record) => getLabelName({ list: ENTERPRISE_PLAN_AUDIT_STATUS_ENUM, status: record.auditFlag }) || "暂存",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "操作",
|
||||||
|
width: 150,
|
||||||
|
fixed: "right",
|
||||||
|
render: (_, record) => (
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./view?id=${record.id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</Button>
|
||||||
|
{(!record.auditFlag || record.auditFlag !== 3) && (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
onClick={() => {
|
||||||
|
props.history.push(`./add?id=${record.id}&planName=${record.planName}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
{(!record.auditFlag || record.auditFlag !== 3) && (
|
||||||
|
<Button
|
||||||
|
type="link"
|
||||||
|
danger
|
||||||
|
onClick={() => {
|
||||||
|
onDelete(record);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
{...tableProps}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default List;
|
export default Connect([NS_ENTERPRISE_PLAN], true)(List);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue