Compare commits
No commits in common. "51bea3ca02a39fb315f64f88607d8ffe0dffc3cf" and "0a11ae9c80ff21c453f4979706ea1993673e3af4" have entirely different histories.
51bea3ca02
...
0a11ae9c80
|
|
@ -10,7 +10,7 @@ module.exports = {
|
|||
javaGitBranch: "<branch-name>",
|
||||
// 本地联调 safety-eval-service(context-path: /safety-eval,默认端口 8095)
|
||||
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
|
||||
API_HOST: "http://192.168.0.149:8095",
|
||||
API_HOST: process.env.SAFETY_EVAL_API_HOST || "http://127.0.0.1:8095",
|
||||
},
|
||||
production: {
|
||||
// 应用后端分支名称,部署上线需要
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import {
|
|||
Col,
|
||||
DatePicker,
|
||||
Form,
|
||||
Image,
|
||||
Input,
|
||||
InputNumber,
|
||||
message,
|
||||
|
|
@ -13,8 +12,6 @@ import {
|
|||
Space,
|
||||
Upload,
|
||||
} from "antd";
|
||||
import { PlusOutlined } from "@ant-design/icons";
|
||||
|
||||
import dayjs from "dayjs";
|
||||
import { useEffect, useState } from "react";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
|
|
@ -44,7 +41,6 @@ function OrgInfoPage(props) {
|
|||
const [editing, setEditing] = useState(true);
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [detail, setDetail] = useState({});
|
||||
const [previewImage, setPreviewImage] = useState("");
|
||||
/** 是否已存在机构数据(有 id 视为已入库,只能修改) */
|
||||
const [hasExistingData, setHasExistingData] = useState(false);
|
||||
|
||||
|
|
@ -63,6 +59,7 @@ function OrgInfoPage(props) {
|
|||
productionDate: res.data.productionDate
|
||||
? dayjs(res.data.productionDate)
|
||||
: undefined,
|
||||
|
||||
});
|
||||
setHasExistingData(true);
|
||||
setEditing(false);
|
||||
|
|
@ -148,22 +145,24 @@ function OrgInfoPage(props) {
|
|||
}
|
||||
};
|
||||
|
||||
const subTitleText =
|
||||
"新成立或首次使用系统的安全评价机构,可通过系统提供的引导页面,详细填写机构的基本信息。";
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
title="机构信息管理"
|
||||
extra={
|
||||
hasExistingData &&
|
||||
!editing && (
|
||||
<Button
|
||||
type="primary"
|
||||
loading={orgInfoLoading}
|
||||
onClick={() => setEditing(true)}
|
||||
>
|
||||
<Button type="primary" loading={orgInfoLoading} onClick={() => setEditing(true)}>
|
||||
修改
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
>
|
||||
<p style={{ margin: 0, marginBottom: 24, color: "rgba(0, 0, 0, 0.45)" }}>
|
||||
{subTitleText}
|
||||
</p>
|
||||
<Form form={form} labelCol={{ span: 10 }} disabled={!editing}>
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={12}>
|
||||
|
|
@ -201,11 +200,7 @@ function OrgInfoPage(props) {
|
|||
label="属地"
|
||||
rules={[{ required: true, message: "请选择属地" }]}
|
||||
>
|
||||
<Select
|
||||
options={selectDistrictOptions}
|
||||
placeholder="请选择属地"
|
||||
allowClear
|
||||
/>
|
||||
<Select options={selectDistrictOptions} placeholder="请选择属地" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -330,10 +325,7 @@ function OrgInfoPage(props) {
|
|||
label="安全管理部门负责人联系电话"
|
||||
rules={[phoneRule("安全管理部门负责人联系电话", false)]}
|
||||
>
|
||||
<Input
|
||||
placeholder="请输入安全管理部门负责人联系电话"
|
||||
allowClear
|
||||
/>
|
||||
<Input placeholder="请输入安全管理部门负责人联系电话" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -352,10 +344,7 @@ function OrgInfoPage(props) {
|
|||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="productionDate" label="投产日期">
|
||||
<DatePicker
|
||||
style={{ width: "100%" }}
|
||||
placeholder="请选择投产日期"
|
||||
/>
|
||||
<DatePicker style={{ width: "100%" }} placeholder="请选择投产日期" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -378,12 +367,7 @@ function OrgInfoPage(props) {
|
|||
label="工作场所建筑面积"
|
||||
rules={[positiveNumberRule("工作场所建筑面积", false)]}
|
||||
>
|
||||
<InputNumber
|
||||
style={{ width: "100%" }}
|
||||
min={0}
|
||||
precision={2}
|
||||
placeholder="请输入工作场所建筑面积"
|
||||
/>
|
||||
<InputNumber style={{ width: "100%" }} min={0} precision={2} placeholder="请输入工作场所建筑面积" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -392,12 +376,7 @@ function OrgInfoPage(props) {
|
|||
label="档案室面积"
|
||||
rules={[positiveNumberRule("档案室面积", false)]}
|
||||
>
|
||||
<InputNumber
|
||||
style={{ width: "100%" }}
|
||||
min={0}
|
||||
precision={2}
|
||||
placeholder="请输入档案室面积"
|
||||
/>
|
||||
<InputNumber style={{ width: "100%" }} min={0} precision={2} placeholder="请输入档案室面积" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -406,12 +385,7 @@ function OrgInfoPage(props) {
|
|||
label="专职安全评价师数量"
|
||||
rules={[nonNegativeIntegerRule("专职安全评价师数量", false)]}
|
||||
>
|
||||
<InputNumber
|
||||
style={{ width: "100%" }}
|
||||
min={0}
|
||||
precision={0}
|
||||
placeholder="请输入专职安全评价师数量"
|
||||
/>
|
||||
<InputNumber style={{ width: "100%" }} min={0} precision={0} placeholder="请输入专职安全评价师数量" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -420,48 +394,27 @@ function OrgInfoPage(props) {
|
|||
label="注册安全工程师数量"
|
||||
rules={[nonNegativeIntegerRule("注册安全工程师数量", false)]}
|
||||
>
|
||||
<InputNumber
|
||||
style={{ width: "100%" }}
|
||||
min={0}
|
||||
precision={0}
|
||||
placeholder="请输入注册安全工程师数量"
|
||||
/>
|
||||
<InputNumber style={{ width: "100%" }} min={0} precision={0} placeholder="请输入注册安全工程师数量" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="enterpriseStatus" label="企业状态">
|
||||
<Select
|
||||
options={ENTERPRISE_STATUS_OPTIONS}
|
||||
placeholder="请选择企业状态"
|
||||
allowClear
|
||||
/>
|
||||
<Select options={ENTERPRISE_STATUS_OPTIONS} placeholder="请选择企业状态" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="enterpriseScale" label="企业规模">
|
||||
<Select
|
||||
options={ENTERPRISE_SCALE_OPTIONS}
|
||||
placeholder="请选择企业规模"
|
||||
allowClear
|
||||
/>
|
||||
<Select options={ENTERPRISE_SCALE_OPTIONS} placeholder="请选择企业规模" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="filingType" label="备案类型">
|
||||
<Select
|
||||
options={FILING_TYPE_OPTIONS}
|
||||
placeholder="请选择备案类型"
|
||||
allowClear
|
||||
/>
|
||||
<Select options={FILING_TYPE_OPTIONS} placeholder="请选择备案类型" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="filingRecordStatus" label="备案状态">
|
||||
<Select
|
||||
options={FILING_RECORD_STATUS_OPTIONS}
|
||||
placeholder="请选择备案状态"
|
||||
allowClear
|
||||
/>
|
||||
<Select options={FILING_RECORD_STATUS_OPTIONS} placeholder="请选择备案状态" allowClear />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -469,35 +422,9 @@ function OrgInfoPage(props) {
|
|||
name="attachments"
|
||||
label="上传附件"
|
||||
valuePropName="fileList"
|
||||
getValueFromEvent={({ fileList }) => {
|
||||
return (
|
||||
fileList?.map((file) => {
|
||||
return {
|
||||
url: file.response?.data.url || file.url,
|
||||
uid: file.uid,
|
||||
name: file.name,
|
||||
};
|
||||
}) || []
|
||||
);
|
||||
}}
|
||||
>
|
||||
<Upload
|
||||
maxCount={5}
|
||||
onPreview={(file) => {
|
||||
const isImage = /\.(png|jpe?g|gif|bmp|webp|svg)(\?.*)?$/i.test(file.name || file.url || "");
|
||||
if (isImage) {
|
||||
setPreviewImage(file.url || file.thumbUrl);
|
||||
} else {
|
||||
window.open(file.url || file.thumbUrl);
|
||||
}
|
||||
}}
|
||||
listType="picture-card"
|
||||
action={`${window.process.env.app.API_HOST}/safety-eval/file/upload`}
|
||||
>
|
||||
<button style={{ border: 0, background: "none" }} type="button">
|
||||
<PlusOutlined />
|
||||
<div style={{ marginTop: 8 }}>上传附件</div>
|
||||
</button>
|
||||
<Upload maxCount={5} listType="picture-card">
|
||||
<Button>上传附件</Button>
|
||||
</Upload>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -522,16 +449,6 @@ function OrgInfoPage(props) {
|
|||
</Space>
|
||||
</div>
|
||||
)}
|
||||
<Image
|
||||
style={{ display: "none" }}
|
||||
preview={{
|
||||
visible: !!previewImage,
|
||||
src: previewImage,
|
||||
onVisibleChange: (visible) => {
|
||||
if (!visible) setPreviewImage("");
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
function PersonnelInfo(props) {
|
||||
return (
|
||||
props.children
|
||||
<div>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import React from "react";
|
|||
|
||||
export default (props)=>{
|
||||
return (
|
||||
props.children
|
||||
<div style={{height: "100%"}}>
|
||||
{props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue