master
parent
97e4a681f3
commit
470bcbd160
|
|
@ -9,7 +9,8 @@ module.exports = {
|
|||
// 应用后端分支名称,部署上线需要
|
||||
javaGitBranch: "<branch-name>",
|
||||
// 接口服务地址
|
||||
API_HOST: "http://192.168.20.100:30140",
|
||||
// API_HOST: "http://192.168.20.100:30140",
|
||||
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
},
|
||||
production: {
|
||||
// 应用后端分支名称,部署上线需要
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-to-print": "^3.2.0",
|
||||
"zy-react-library": "^1.0.175"
|
||||
"zy-react-library": "^1.1.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import "dayjs/locale/zh-cn";
|
|||
import "../blessed_by_buddha";
|
||||
|
||||
require("antd/dist/reset.css");
|
||||
require("zy-react-library/css/common.less");
|
||||
|
||||
dayjs.locale("zh-cn");
|
||||
setJJBCommonAntdMessage(message);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Form, message } from "antd";
|
|||
import { useEffect } from "react";
|
||||
import Editor from "zy-react-library/components/Editor";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
|
@ -27,17 +27,16 @@ function Add(props) {
|
|||
...values,
|
||||
id: query.id,
|
||||
promiseId: query.promiseId,
|
||||
isRegulatory: 0,
|
||||
isRegulatory: 1,
|
||||
});
|
||||
if (success) {
|
||||
message.success("操作成功");
|
||||
props.history.goBack();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title={query.id ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
|
|
@ -79,8 +78,7 @@ function Add(props) {
|
|||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,19 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
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 { NS_COMMITMENT } from "~/enumerate/namespace";
|
||||
import DetailModal from "~/pages/Container/Supervise/Components/DetailModal";
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["busPromiseTemplateList"], {
|
||||
form,
|
||||
});
|
||||
const [busPromiseTemplateModalOpen, setBusPromiseTemplateModalOpen] = useState(false);
|
||||
const [id, setId] = useState("");
|
||||
const [modalUrl, setModalUrl] = useState("");
|
||||
const updateState = (id, state) => {
|
||||
const stateValue = state === 0 ? 1 : 0;
|
||||
Modal.confirm({
|
||||
|
|
@ -33,7 +29,7 @@ function List(props) {
|
|||
});
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
labelCol={{ span: 8 }}
|
||||
form={form}
|
||||
|
|
@ -72,9 +68,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(record.id);
|
||||
setModalUrl("busPromiseTemplateView");
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
|
|
@ -100,8 +94,7 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
import { Button, Descriptions } from "antd";
|
||||
import { useRef, useState } from "react";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import DetailModal from "~/pages/Container/Enterprise/components/DetailModal";
|
||||
|
||||
function View() {
|
||||
const query = useGetUrlQuery();
|
||||
|
||||
const [info, setInfo] = useState({});
|
||||
|
||||
const contentRef = useRef(null);
|
||||
const handlePrint = useReactToPrint({
|
||||
contentRef,
|
||||
pageStyle: `@page {
|
||||
margin: 0mm;
|
||||
}
|
||||
@media print {
|
||||
body {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
`,
|
||||
documentTitle: "",
|
||||
});
|
||||
|
||||
return (
|
||||
<Page
|
||||
headerTitle="查看"
|
||||
extraActionButtons={(
|
||||
<Button type="primary" onClick={handlePrint}>
|
||||
打印模板
|
||||
</Button>
|
||||
)}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
column={1}
|
||||
styles={{ label: { width: 200 } }}
|
||||
items={[
|
||||
{ label: "安全承诺模板名称", children: info.promiseName },
|
||||
{ label: "安全承诺级别", children: info.levelName },
|
||||
]}
|
||||
/>
|
||||
<div ref={contentRef}>
|
||||
<DetailModal
|
||||
id={query.id}
|
||||
modalUrl="busPromiseTemplateView"
|
||||
inline
|
||||
onGetData={(data) => {
|
||||
setInfo(data);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
|
|
@ -5,7 +5,7 @@ import { cloneDeep } from "lodash-es";
|
|||
import { useEffect, useState } from "react";
|
||||
import Editor from "zy-react-library/components/Editor";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||
|
|
@ -110,9 +110,7 @@ function Add(props) {
|
|||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title={query.id ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
|
|
@ -352,8 +350,7 @@ function Add(props) {
|
|||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -365,6 +362,7 @@ const ChoiceTemplateModalComponent = (props) => {
|
|||
|
||||
return (
|
||||
<Modal
|
||||
title="选择模板"
|
||||
open
|
||||
width={1200}
|
||||
maskClosable={false}
|
||||
|
|
@ -383,6 +381,8 @@ const ChoiceTemplateModalComponent = (props) => {
|
|||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
options={false}
|
||||
disabledResizer={true}
|
||||
columns={[
|
||||
{ title: "安全承诺名称", dataIndex: "promiseName" },
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { NS_COMMITMENT } from "~/enumerate/namespace";
|
||||
import DetailModal from "~/pages/Container/Supervise/Components/DetailModal";
|
||||
|
|
@ -21,10 +21,24 @@ function Detail(props) {
|
|||
useEffect(() => {
|
||||
getData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page
|
||||
headerTitle="查看"
|
||||
contentPadding="0 20px 20px 20px"
|
||||
extraActionButtons={(
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
setModalUrl("busPromiseView");
|
||||
}}
|
||||
>
|
||||
模板
|
||||
</Button>
|
||||
)}
|
||||
>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
|
@ -74,21 +88,8 @@ function Detail(props) {
|
|||
{ label: "人员", children: detail.promisePeople?.userName || "-" },
|
||||
]}
|
||||
/>
|
||||
<div style={{ textAlign: "center", margin: "20px 0" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
setModalUrl("busPromiseView");
|
||||
}}
|
||||
>
|
||||
模板
|
||||
</Button>
|
||||
</div>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
|||
import { Button, Form, message, Modal, Space, Tooltip } from "antd";
|
||||
import dayjs from "dayjs";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
|
@ -39,7 +40,7 @@ function List(props) {
|
|||
}
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
|
|
@ -133,7 +134,7 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -19,15 +19,15 @@ function List(props) {
|
|||
const [busPromiseTemplateModalOpen, setBusPromiseTemplateModalOpen] = useState(false);
|
||||
const [id, setId] = useState("");
|
||||
const [modalUrl, setModalUrl] = useState("");
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="签署详情" />
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page headerTitle="签署详情">
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
|
|
@ -67,9 +67,7 @@ function List(props) {
|
|||
{...tableProps}
|
||||
/>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Form, message } from "antd";
|
|||
import { useEffect } from "react";
|
||||
import Editor from "zy-react-library/components/Editor";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
|
@ -32,17 +32,16 @@ function Add(props) {
|
|||
...values,
|
||||
id: query.id,
|
||||
promiseId: query.promiseId,
|
||||
isRegulatory: 1,
|
||||
isRegulatory: 0,
|
||||
});
|
||||
if (success) {
|
||||
message.success("操作成功");
|
||||
props.history.goBack();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title={query.id ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<Page isShowFooter={false} headerTitle={query.id ? "编辑" : "新增"}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onFinish={onSubmit}
|
||||
|
|
@ -77,8 +76,7 @@ function Add(props) {
|
|||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
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 { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -10,16 +10,12 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { PROMISE_TYPE_ENUM } from "~/enumerate/constant";
|
||||
import { NS_COMMITMENT } from "~/enumerate/namespace";
|
||||
import DetailModal from "~/pages/Container/Supervise/Components/DetailModal";
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["busPromiseTemplateList"], {
|
||||
form,
|
||||
});
|
||||
const [busPromiseTemplateModalOpen, setBusPromiseTemplateModalOpen] = useState(false);
|
||||
const [id, setId] = useState("");
|
||||
const [modalUrl, setModalUrl] = useState("");
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "删除确认",
|
||||
|
|
@ -48,7 +44,7 @@ function List(props) {
|
|||
});
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
labelCol={{ span: 8 }}
|
||||
form={form}
|
||||
|
|
@ -90,19 +86,17 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(record.id);
|
||||
setModalUrl("busPromiseTemplateView");
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
{(props.permission("jg-promise-template-disable") && record.isRegulatory === 1) && (
|
||||
{(props.permission("jg-promise-template-disable") && record.isRegulatory === 0) && (
|
||||
<Button type="link" onClick={() => updateState(record.id, record.state)}>
|
||||
{record.state === 0 ? "禁用" : "启用"}
|
||||
</Button>
|
||||
)}
|
||||
{(props.permission("jg-promise-template-edit") && record.isRegulatory === 1) && (
|
||||
{(props.permission("jg-promise-template-edit") && record.isRegulatory === 0) && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
|
|
@ -112,15 +106,14 @@ function List(props) {
|
|||
编辑
|
||||
</Button>
|
||||
)}
|
||||
{(props.permission("jg-promise-template-deletes") && record.isRegulatory === 1) && <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>}
|
||||
{(props.permission("jg-promise-template-deletes") && record.isRegulatory === 0) && <Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
import { Button, Descriptions } from "antd";
|
||||
import { useRef, useState } from "react";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { PROMISE_TYPE_ENUM } from "~/enumerate/constant";
|
||||
import DetailModal from "~/pages/Container/Supervise/components/DetailModal";
|
||||
|
||||
function View() {
|
||||
const query = useGetUrlQuery();
|
||||
|
||||
const [info, setInfo] = useState({});
|
||||
|
||||
const contentRef = useRef(null);
|
||||
const handlePrint = useReactToPrint({
|
||||
contentRef,
|
||||
pageStyle: `@page {
|
||||
margin: 0mm;
|
||||
}
|
||||
@media print {
|
||||
body {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
`,
|
||||
documentTitle: "",
|
||||
});
|
||||
|
||||
return (
|
||||
<Page
|
||||
headerTitle="查看"
|
||||
extraActionButtons={(
|
||||
<Button type="primary" onClick={handlePrint}>
|
||||
打印模板
|
||||
</Button>
|
||||
)}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
column={1}
|
||||
styles={{ label: { width: 200 } }}
|
||||
items={[
|
||||
{ label: "公司名称", children: info.corpName },
|
||||
{ label: "安全承诺模板名称", children: info.promiseName },
|
||||
{ label: "安全承诺类型", children: getLabelName({ list: PROMISE_TYPE_ENUM, status: info.promiseType }) },
|
||||
{ label: "安全承诺级别", children: info.levelName },
|
||||
]}
|
||||
/>
|
||||
<div ref={contentRef}>
|
||||
<DetailModal
|
||||
id={query.id}
|
||||
modalUrl="busPromiseTemplateView"
|
||||
inline
|
||||
onGetData={(data) => {
|
||||
setInfo(data);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
|
|
@ -5,7 +5,7 @@ import { cloneDeep } from "lodash-es";
|
|||
import { useEffect, useState } from "react";
|
||||
import Editor from "zy-react-library/components/Editor";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import PersonnelSelect from "zy-react-library/components/Select/Personnel/Gwj";
|
||||
|
|
@ -55,8 +55,8 @@ function Add(props) {
|
|||
const { data } = await props["busPromiseView"]({ id: query.id });
|
||||
const promisePeopleBack = data.promisePeopleBack.map(item => ({
|
||||
...item,
|
||||
userName: item.userName.split(","),
|
||||
userId: item.userId.split(","),
|
||||
userName: data.promiseType === 1 ? item.userName : item.userName.split(","),
|
||||
userId: data.promiseType === 1 ? item.userId : item.userId.split(","),
|
||||
}));
|
||||
const values = {
|
||||
...data,
|
||||
|
|
@ -81,15 +81,21 @@ function Add(props) {
|
|||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
await isExistenceDuplicateSelection({ data: values.promisePersons, key: "userId", message: `${promiseType === 1 ? "受状人" : "承诺人"}不能重复` });
|
||||
if (promiseType === 1) {
|
||||
await isExistenceDuplicateSelection({ data: values.promisePersons, key: "userId", message: "受状人不能重复" });
|
||||
}
|
||||
else {
|
||||
await isExistenceDuplicateSelection({ data: values.promisePersons, key: "postId", message: "承诺人岗位不能重复" });
|
||||
}
|
||||
const peoples = values.promisePeoples.map(item => ({
|
||||
...item,
|
||||
isPromisePeople: 1,
|
||||
}));
|
||||
const peopleNumInvolved = values.promisePersons.reduce((acc, item) => acc + item.userName.length, 0);
|
||||
const persons = values.promisePersons.map(item => ({
|
||||
...item,
|
||||
userName: item.userName,
|
||||
userId: item.userId,
|
||||
userName: Array.isArray(item.userName) ? item.userName.join(",") : item.userName,
|
||||
userId: Array.isArray(item.userId) ? item.userId.join(",") : item.userId,
|
||||
isPromisePeople: 0,
|
||||
}));
|
||||
const promiseAll = [...peoples, ...persons];
|
||||
|
|
@ -98,7 +104,7 @@ function Add(props) {
|
|||
id: query.id,
|
||||
promiseId: query.promiseId,
|
||||
promisePeoples: promiseAll,
|
||||
peopleNumInvolved: values.promisePersons.length,
|
||||
peopleNumInvolved,
|
||||
});
|
||||
if (success) {
|
||||
message.success("操作成功");
|
||||
|
|
@ -107,9 +113,7 @@ function Add(props) {
|
|||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title={query.id ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<Page headerTitle={query.id ? "编辑" : "新增"} isShowFooter={false}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
|
|
@ -226,8 +230,8 @@ function Add(props) {
|
|||
form.setFieldValue(["promisePersons", field.name, "departmentName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "postId"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "postName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], promiseType === 1 ? "" : []);
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], promiseType === 1 ? "" : []);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -246,8 +250,8 @@ function Add(props) {
|
|||
onChange={(departmentId) => {
|
||||
form.setFieldValue(["promisePersons", field.name, "postId"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "postName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], promiseType === 1 ? "" : []);
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], promiseType === 1 ? "" : []);
|
||||
if (!departmentId)
|
||||
return;
|
||||
getPostList(departmentId, promisePersons?.[field.name]?.corpId, index);
|
||||
|
|
@ -275,8 +279,8 @@ function Add(props) {
|
|||
nameKey: "postName",
|
||||
idKey: "id",
|
||||
}));
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], "");
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], promiseType === 1 ? "" : []);
|
||||
form.setFieldValue(["promisePersons", field.name, "userId"], promiseType === 1 ? "" : []);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -297,6 +301,7 @@ function Add(props) {
|
|||
onGetLabel={(label) => {
|
||||
form.setFieldValue(["promisePersons", field.name, "userName"], label);
|
||||
}}
|
||||
mode={promiseType === 1 ? "" : "multiple"}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
|
@ -383,7 +388,6 @@ function Add(props) {
|
|||
]),
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
{choiceTemplateModalOpen && (
|
||||
<ChoiceTemplateModal
|
||||
onCancel={() => setChoiceTemplateModalOpen(false)}
|
||||
|
|
@ -401,7 +405,7 @@ function Add(props) {
|
|||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -414,6 +418,7 @@ const ChoiceTemplateModalComponent = (props) => {
|
|||
|
||||
return (
|
||||
<Modal
|
||||
title="选择模板"
|
||||
open
|
||||
width={1200}
|
||||
maskClosable={false}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Divider, Spin } from "antd";
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { PROMISE_TYPE_ENUM, RELEASE_PLATFORM_ENUM } from "~/enumerate/constant";
|
||||
|
|
@ -26,10 +26,22 @@ function Detail(props) {
|
|||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<Spin spinning={props.commitment.commitmentLoading}>
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page
|
||||
headerTitle="查看"
|
||||
contentPadding="0 20px 20px 20px"
|
||||
extraActionButtons={(
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
setModalUrl("busPromiseView");
|
||||
}}
|
||||
>
|
||||
模板
|
||||
</Button>
|
||||
)}
|
||||
>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
|
@ -89,22 +101,8 @@ function Detail(props) {
|
|||
{ label: "人员", children: detail.promisePeople?.userName || "-" },
|
||||
]}
|
||||
/>
|
||||
<div style={{ textAlign: "center", margin: "20px 0" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
setModalUrl("busPromiseView");
|
||||
}}
|
||||
>
|
||||
模板
|
||||
</Button>
|
||||
</div>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Button, Form, message, Modal, Space, Tabs, Tooltip } from "antd";
|
|||
import dayjs from "dayjs";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
@ -56,7 +57,7 @@ function List(props) {
|
|||
};
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
|
|
@ -191,7 +192,7 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -20,14 +20,13 @@ function List(props) {
|
|||
const [id, setId] = useState("");
|
||||
const [modalUrl, setModalUrl] = useState("");
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="签署详情" />
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page headerTitle="签署详情">
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
|
|
@ -67,8 +66,7 @@ function List(props) {
|
|||
{...tableProps}
|
||||
/>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
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 { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
|
@ -13,7 +14,7 @@ function List(props) {
|
|||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Page isShowAllAction={false}>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
|
|
@ -49,7 +50,7 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { NS_COMMITMENT } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -18,9 +18,7 @@ function List(props) {
|
|||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div style={{ padding: "0 20px 20px 20px" }}>
|
||||
<Page headerTitle="查看">
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
|
|
@ -44,7 +42,7 @@ function List(props) {
|
|||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./view?id=${record.id}`);
|
||||
props.history.push(`./view?id=${record.id}&promiseId=${record.promiseId}`);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
|
|
@ -55,8 +53,7 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Page>
|
||||
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Page from "zy-react-library/components/Page";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -16,15 +16,28 @@ function List(props) {
|
|||
const query = useGetUrlQuery();
|
||||
const { tableProps } = useTable(props["busPromisePeopleList"], {
|
||||
params: {
|
||||
corpId: query.id,
|
||||
promiseId: query.promiseId,
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div style={{ padding: "0 20px 20px 20px" }}>
|
||||
<Page headerTitle="详情列表">
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Space>
|
||||
<Button
|
||||
type="primary"
|
||||
ghost
|
||||
onClick={() => {
|
||||
setBusPromiseTemplateModalOpen(true);
|
||||
setId(query.id);
|
||||
setModalUrl("busPromisePeopleAllSign");
|
||||
}}
|
||||
>
|
||||
签署汇总
|
||||
</Button>
|
||||
</Space>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "所属部门", dataIndex: "departmentName" },
|
||||
{ title: "姓名", dataIndex: "userName" },
|
||||
|
|
@ -52,9 +65,7 @@ function List(props) {
|
|||
{...tableProps}
|
||||
/>
|
||||
{busPromiseTemplateModalOpen && <DetailModal onCancel={() => setBusPromiseTemplateModalOpen(false)} id={id} modalUrl={modalUrl} />}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const DetailModal = (props) => {
|
|||
if (props.id) {
|
||||
const { data } = await props[props.modalUrl]({ id: props.id });
|
||||
setForm(data);
|
||||
props.onGetData?.(data);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
|
|
@ -34,16 +35,9 @@ const DetailModal = (props) => {
|
|||
`,
|
||||
documentTitle: "",
|
||||
});
|
||||
|
||||
const renderContent = () => {
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
title={form.promiseType === 0 ? "安全生产承诺书" : "安全生产责任状"}
|
||||
open
|
||||
onCancel={props.onCancel}
|
||||
okText="打印"
|
||||
onOk={handlePrint}
|
||||
width={800}
|
||||
>
|
||||
<div ref={contentRef} className="dialogContent">
|
||||
<div className="cover print_use">
|
||||
<h1>{form.promiseType === 0 ? "安全生产承诺书" : "安全生产责任状"}</h1>
|
||||
|
|
@ -62,7 +56,7 @@ const DetailModal = (props) => {
|
|||
|
||||
{form.promiseType === 0 && (
|
||||
<div>
|
||||
{`${form.promisePeople ? `${form.promisePeople + form.promisePeoplePost}:` : ""}` || ""}
|
||||
{`${(form.promisePeople && form.promisePeoplePost) ? `${form.promisePeople + form.promisePeoplePost}:` : ""}` || ""}
|
||||
</div>
|
||||
)}
|
||||
<div dangerouslySetInnerHTML={{ __html: form.promiseText }} />
|
||||
|
|
@ -82,21 +76,10 @@ const DetailModal = (props) => {
|
|||
<div style={{ alignItems: form.filepath ? "flex-end" : "flex-start" }}>
|
||||
{form.promiseType === 1 && (
|
||||
<div className="hairdresser">
|
||||
{!form.filepath
|
||||
? (
|
||||
<div className="promiser">
|
||||
发状人:
|
||||
{form.userName}
|
||||
{form.promisePeople}
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
<div className="promiser">
|
||||
<span style={{ marginRight: form.filepath ? "0px" : "105px" }}>
|
||||
发状人:
|
||||
<Image src={getFileUrl() + form.filepath} alt="sign" width={100} height={100} />
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
|
@ -113,6 +96,25 @@ const DetailModal = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
if (props.inline) {
|
||||
return renderContent();
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
title={form.promiseType === 0 ? "安全生产承诺书" : "安全生产责任状"}
|
||||
open
|
||||
maskClosable={false}
|
||||
onCancel={props.onCancel}
|
||||
okText="打印"
|
||||
onOk={handlePrint}
|
||||
width={800}
|
||||
>
|
||||
{renderContent()}
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue