fix
parent
72396972a5
commit
994b24a8c3
|
|
@ -375,7 +375,9 @@ function CertModal({
|
|||
<Form.Item name="reviewDate" label="复核日期">
|
||||
<DatePicker style={{ width: "100%" }} />
|
||||
</Form.Item>
|
||||
<AttachmentUpload name="certAttachmentUrl" label="证书附件" maxCount={10} accept="image/*,.pdf" />
|
||||
<AttachmentUpload name="certAttachmentUrl" label="证书附件" maxCount={10} accept="image/*,.pdf"
|
||||
extra={'请上传证书附件,支持10个以内的图片和PDF格式'}
|
||||
/>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -710,6 +710,7 @@ function StaffFormModal({
|
|||
<AttachmentUpload
|
||||
name="proofMaterialUrl"
|
||||
label="申报专业能力证明材料"
|
||||
extra={'最多上传5个文件'}
|
||||
maxCount={5}
|
||||
/>
|
||||
</Col>
|
||||
|
|
|
|||
|
|
@ -369,21 +369,21 @@ function CertFormModal({
|
|||
label="证书名称"
|
||||
rules={[{ required: true, message: "请输入证书名称" }]}
|
||||
>
|
||||
<Input placeholder="请输入证书名称" />
|
||||
<Input placeholder="请输入证书名称" maxLength={50} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="certNo"
|
||||
label="证明编号"
|
||||
rules={[{ required: true, message: "请输入证明编号" }]}
|
||||
>
|
||||
<Input placeholder="请输入证明编号" />
|
||||
<Input placeholder="请输入证明编号" maxLength={30} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="issueOrg"
|
||||
label="发证机关"
|
||||
rules={[{ required: true, message: "请输入发证机关" }]}
|
||||
>
|
||||
<Input placeholder="请输入发证机关" />
|
||||
<Input placeholder="请输入发证机关" maxLength={50} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="issueDate"
|
||||
|
|
@ -403,9 +403,9 @@ function CertFormModal({
|
|||
<RangePicker style={{ width: "100%" }} />
|
||||
</Form.Item>
|
||||
<Form.Item name="remark" label="备注">
|
||||
<TextArea rows={3} placeholder="请输入备注" />
|
||||
<TextArea rows={3} placeholder="请输入备注" maxLength={200} showCount />
|
||||
</Form.Item>
|
||||
<AttachmentUpload name="certImageUrl" accept="image/*" label="证书图片" maxCount={3} />
|
||||
<AttachmentUpload name="certImageUrl" accept="image/*" label="证书图片" maxCount={3} extra="最多上传3张图片" />
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -297,6 +297,7 @@ function AddModal({ open, staffOptions, requestAdd, onCancel, onSuccess }) {
|
|||
<AttachmentUpload
|
||||
name="reportFileUrl"
|
||||
label="离职通知报告"
|
||||
extra={'最多上传1个PDF文件'}
|
||||
maxCount={1}
|
||||
accept=".pdf"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -81,13 +81,33 @@ export default function BasicInfoStep({ form, disabled }) {
|
|||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="legalPersonPhone" label="法人代表及电话">
|
||||
<Input placeholder="姓名 / 电话" maxLength={32} />
|
||||
<Form.Item
|
||||
name="legalPersonPhone"
|
||||
label="法人代表电话"
|
||||
|
||||
rules={[
|
||||
{
|
||||
pattern: /^(1\d{10}|0\d{2,3}-?\d{7,8})$/,
|
||||
message: "请输入正确的手机号或座机号",
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入法人代表电话" maxLength={11} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="contactPhone" label="联系人及电话">
|
||||
<Input placeholder="姓名 / 电话" maxLength={32} />
|
||||
<Form.Item
|
||||
name="contactPhone"
|
||||
label="联系人电话"
|
||||
|
||||
rules={[
|
||||
{
|
||||
pattern: /^(1\d{10}|0\d{2,3}-?\d{7,8})$/,
|
||||
message: "请输入正确的手机号或座机号",
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入联系人电话" maxLength={11} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
|
|
@ -169,6 +189,7 @@ export default function BasicInfoStep({ form, disabled }) {
|
|||
name="attachmentUrl"
|
||||
label="上传附件"
|
||||
disabled={disabled}
|
||||
extra={'最多上传12个PDF、DOC、DOCX格式文件'}
|
||||
maxCount={12}
|
||||
accept=".pdf,.doc,.docx"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,21 @@
|
|||
import {
|
||||
Button, DatePicker, Descriptions, Form, Input, InputNumber, message, Modal, Row, Col, Select, Space, Tag, Table,
|
||||
Button,
|
||||
DatePicker,
|
||||
Descriptions,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
message,
|
||||
Modal,
|
||||
Row,
|
||||
Col,
|
||||
Select,
|
||||
Space,
|
||||
Tag,
|
||||
Table,
|
||||
} from "antd";
|
||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { useEffect, useState } from "react";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
|
|
@ -13,11 +27,13 @@ import {
|
|||
CHONGQING_DISTRICTS,
|
||||
ENTERPRISE_SCALE_OPTIONS,
|
||||
ORG_ACCOUNT_STATE_OPTIONS,
|
||||
ENTERPRISE_STATUS_OPTIONS
|
||||
ENTERPRISE_STATUS_OPTIONS,
|
||||
} from "~/enumerate/enterpriseOptions";
|
||||
import { NS_ORG_INFO } from "~/enumerate/namespace";
|
||||
import { safeListRequest, safeRequest } from "~/utils";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
function OrgAccountPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const [editForm] = Form.useForm();
|
||||
|
|
@ -31,14 +47,23 @@ function OrgAccountPage(props) {
|
|||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
|
||||
|
||||
const getData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const raw = searchForm.getFieldsValue();
|
||||
const params = {
|
||||
...raw,
|
||||
state: raw.state !== "" && raw.state !== undefined ? Number(raw.state) : undefined,
|
||||
...(Array.isArray(raw.openTimeRange) && raw.openTimeRange[0] && raw.openTimeRange[1]
|
||||
current: router.query.current || 1,
|
||||
pageSize: router.query.pageSize || 10,
|
||||
state:
|
||||
raw.state !== "" && raw.state !== undefined
|
||||
? Number(raw.state)
|
||||
: undefined,
|
||||
...(Array.isArray(raw.openTimeRange) &&
|
||||
raw.openTimeRange[0] &&
|
||||
raw.openTimeRange[1]
|
||||
? {
|
||||
createTimeStart: raw.openTimeRange[0].format("YYYY-MM-DD"),
|
||||
createTimeEnd: raw.openTimeRange[1].format("YYYY-MM-DD"),
|
||||
|
|
@ -46,17 +71,19 @@ function OrgAccountPage(props) {
|
|||
: {}),
|
||||
};
|
||||
delete params.openTimeRange;
|
||||
Object.keys(params).forEach((k) => { if (params[k] === undefined) delete params[k]; });
|
||||
Object.keys(params).forEach((k) => {
|
||||
if (params[k] === undefined) delete params[k];
|
||||
});
|
||||
const res = await safeListRequest(props.orgAccountList)(params);
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
setTotal(res?.total || 0);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getData();
|
||||
getData(1, 10);
|
||||
}, []);
|
||||
|
||||
const loadDetail = async (id) => {
|
||||
|
|
@ -86,17 +113,21 @@ function OrgAccountPage(props) {
|
|||
const enabled = isOrgAccountEnabled(record);
|
||||
Modal.confirm({
|
||||
title: "确认操作",
|
||||
content: enabled ? `确认禁用「${record.unitName}」账号?` : `确认启用「${record.unitName}」账号?`,
|
||||
content: enabled
|
||||
? `确认禁用「${record.unitName}」账号?`
|
||||
: `确认启用「${record.unitName}」账号?`,
|
||||
okText: "确认",
|
||||
cancelText: "取消",
|
||||
onOk: async () => {
|
||||
const nextState = enabled ? 1 : 0;
|
||||
const res = await props.orgAccountUpdateState({ id: record.id, state: nextState });
|
||||
const res = await props.orgAccountUpdateState({
|
||||
id: record.id,
|
||||
state: nextState,
|
||||
});
|
||||
if (res?.success !== false) {
|
||||
message.success("操作成功");
|
||||
await getData();
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -112,7 +143,9 @@ function OrgAccountPage(props) {
|
|||
<strong>{record.unitName}</strong>
|
||||
的密码重置为初始密码?
|
||||
</p>
|
||||
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>初始密码:a123456</p>
|
||||
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>
|
||||
初始密码:a123456
|
||||
</p>
|
||||
</div>
|
||||
),
|
||||
okText: "确认重置",
|
||||
|
|
@ -122,7 +155,6 @@ function OrgAccountPage(props) {
|
|||
if (res?.success !== false) {
|
||||
message.success("密码已重置");
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -137,7 +169,9 @@ function OrgAccountPage(props) {
|
|||
<strong>{record.unitName}</strong>
|
||||
的账号?
|
||||
</p>
|
||||
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>此操作不可恢复,请谨慎操作。</p>
|
||||
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>
|
||||
此操作不可恢复,请谨慎操作。
|
||||
</p>
|
||||
</div>
|
||||
),
|
||||
okText: "确认删除",
|
||||
|
|
@ -149,7 +183,6 @@ function OrgAccountPage(props) {
|
|||
message.success("删除成功");
|
||||
await getData();
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -169,7 +202,6 @@ function OrgAccountPage(props) {
|
|||
editForm.resetFields();
|
||||
await getData();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const columns = [
|
||||
|
|
@ -191,11 +223,32 @@ function OrgAccountPage(props) {
|
|||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<TableAction>
|
||||
<Button type="link" size="small" onClick={() => openView(record.id)}>查看</Button>
|
||||
<Button type="link" size="small" onClick={() => openEdit(record.id)}>编辑</Button>
|
||||
<Button type="link" size="small" onClick={() => onResetPassword(record)}>重置密码</Button>
|
||||
<Button type="link" size="small" danger onClick={() => onDelete(record)}>删除</Button>
|
||||
<Button type="link" size="small" onClick={() => onToggleStatus(record)}>
|
||||
<Button type="link" size="small" onClick={() => openView(record.id)}>
|
||||
查看
|
||||
</Button>
|
||||
<Button type="link" size="small" onClick={() => openEdit(record.id)}>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => onResetPassword(record)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
onClick={() => onDelete(record)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => onToggleStatus(record)}
|
||||
>
|
||||
{isOrgAccountEnabled(record) ? "禁用" : "启用"}
|
||||
</Button>
|
||||
</TableAction>
|
||||
|
|
@ -208,9 +261,7 @@ function OrgAccountPage(props) {
|
|||
title={
|
||||
<div>
|
||||
<span>评价机构账号管理</span>
|
||||
<div className="pageLayout-extra">
|
||||
监管端维护评价机构开户账号。
|
||||
</div>
|
||||
<div className="pageLayout-extra">监管端维护评价机构开户账号。</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
|
|
@ -220,31 +271,62 @@ function OrgAccountPage(props) {
|
|||
loading={loading}
|
||||
formLine={[
|
||||
<Form.Item key="unitName" name="unitName">
|
||||
<ControlWrapper.Input label="机构名称" placeholder="关键字搜索" allowClear />
|
||||
<ControlWrapper.Input
|
||||
label="机构名称"
|
||||
placeholder="关键字搜索"
|
||||
allowClear
|
||||
/>
|
||||
</Form.Item>,
|
||||
<Form.Item key="districtName" name="districtName">
|
||||
<ControlWrapper.Select label="属地" placeholder="请选择属地" allowClear>
|
||||
<ControlWrapper.Select
|
||||
label="属地"
|
||||
placeholder="请选择属地"
|
||||
allowClear
|
||||
>
|
||||
{CHONGQING_DISTRICTS.map((opt) => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
<Select.Option key={opt.value} value={opt.value}>
|
||||
{opt.label}
|
||||
</Select.Option>
|
||||
))}
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
<Form.Item key="state" name="state">
|
||||
<ControlWrapper.Select label="状态" placeholder="请选择状态" allowClear>
|
||||
<ControlWrapper.Select
|
||||
label="状态"
|
||||
placeholder="请选择状态"
|
||||
allowClear
|
||||
>
|
||||
{ORG_ACCOUNT_STATE_OPTIONS.map((opt) => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
<Select.Option key={opt.value} value={opt.value}>
|
||||
{opt.label}
|
||||
</Select.Option>
|
||||
))}
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
<Form.Item key="openTimeRange" name="openTimeRange">
|
||||
<ControlWrapper.DatePicker.RangePicker label="开户时间" allowClear />
|
||||
<ControlWrapper.DatePicker.RangePicker
|
||||
label="开户时间"
|
||||
allowClear
|
||||
/>
|
||||
</Form.Item>,
|
||||
]}
|
||||
onReset={() => {
|
||||
onReset={(values) => {
|
||||
searchForm.resetFields();
|
||||
router.query = {
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
getData();
|
||||
}}
|
||||
onFinish={() => getData()}
|
||||
onFinish={(values) => {
|
||||
router.query = {
|
||||
...values,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
getData()
|
||||
}}
|
||||
/>
|
||||
<Table
|
||||
rowKey="id"
|
||||
|
|
@ -257,9 +339,10 @@ function OrgAccountPage(props) {
|
|||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
current: router.query.current || 1,
|
||||
pageSize: router.query.pageSize || 10,
|
||||
onChange: (page, pageSize) => {
|
||||
router.query = { ...router.query, current: page, pageSize };
|
||||
getData();
|
||||
},
|
||||
}}
|
||||
|
|
@ -273,22 +356,49 @@ function OrgAccountPage(props) {
|
|||
loading={detailLoading}
|
||||
cancelText="关闭"
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
onCancel={() => { setViewOpen(false); setDetail(null); }}
|
||||
onCancel={() => {
|
||||
setViewOpen(false);
|
||||
setDetail(null);
|
||||
}}
|
||||
>
|
||||
{detail && (
|
||||
<Descriptions bordered column={2} size="small">
|
||||
<Descriptions.Item label="机构名称">{detail.unitName}</Descriptions.Item>
|
||||
<Descriptions.Item label="统一社会信用代码">{detail.creditCode}</Descriptions.Item>
|
||||
<Descriptions.Item label="属地">{detail.districtName}</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产监管行业类别">{detail.safetyIndustryCategoryName}</Descriptions.Item>
|
||||
<Descriptions.Item label="经营地址" span={2}>{detail.businessAddress}</Descriptions.Item>
|
||||
<Descriptions.Item label="企业状态">{detail.enterpriseStatusName}</Descriptions.Item>
|
||||
<Descriptions.Item label="经度/纬度">{detail.longitude}, {detail.latitude}</Descriptions.Item>
|
||||
<Descriptions.Item label="主要负责人">{detail.principalName}</Descriptions.Item>
|
||||
<Descriptions.Item label="主要负责人电话">{detail.principalPhone}</Descriptions.Item>
|
||||
<Descriptions.Item label="法定代表人">{detail.legalRepresentative}</Descriptions.Item>
|
||||
<Descriptions.Item label="法人电话">{detail.legalRepresentativePhone}</Descriptions.Item>
|
||||
<Descriptions.Item label="企业规模" span={2}>{detail.enterpriseScaleName}</Descriptions.Item>
|
||||
<Descriptions.Item label="机构名称">
|
||||
{detail.unitName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="统一社会信用代码">
|
||||
{detail.creditCode}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="属地">
|
||||
{detail.districtName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="安全生产监管行业类别">
|
||||
{detail.safetyIndustryCategoryName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经营地址" span={2}>
|
||||
{detail.businessAddress}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="企业状态">
|
||||
{detail.enterpriseStatusName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经度/纬度">
|
||||
{detail.longitude}, {detail.latitude}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="主要负责人">
|
||||
{detail.principalName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="主要负责人电话">
|
||||
{detail.principalPhone}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="法定代表人">
|
||||
{detail.legalRepresentative}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="法人电话">
|
||||
{detail.legalRepresentativePhone}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="企业规模" span={2}>
|
||||
{detail.enterpriseScaleName}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
)}
|
||||
</Modal>
|
||||
|
|
@ -311,22 +421,36 @@ function OrgAccountPage(props) {
|
|||
<Form form={editForm} layout="vertical">
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item name="unitName" label="机构名称" rules={[{ required: true, message: "请输入机构名称" }]}>
|
||||
<Form.Item
|
||||
name="unitName"
|
||||
label="机构名称"
|
||||
rules={[{ required: true, message: "请输入机构名称" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="creditCode" label="统一社会信用代码" rules={[{ required: true, message: "请输入信用代码" }]}>
|
||||
<Form.Item
|
||||
name="creditCode"
|
||||
label="统一社会信用代码"
|
||||
rules={[{ required: true, message: "请输入信用代码" }]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="districtName" label="属地">
|
||||
<Select options={CHONGQING_DISTRICTS} placeholder="请选择属地" />
|
||||
<Select
|
||||
options={CHONGQING_DISTRICTS}
|
||||
placeholder="请选择属地"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="safetyIndustryCategoryName" label="安全生产监管行业类别">
|
||||
<Form.Item
|
||||
name="safetyIndustryCategoryName"
|
||||
label="安全生产监管行业类别"
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
|
@ -372,7 +496,12 @@ function OrgAccountPage(props) {
|
|||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="enterpriseScaleName" label="企业规模">
|
||||
<Select options={ENTERPRISE_SCALE_OPTIONS.map((o) => ({ label: o.label, value: o.label }))} />
|
||||
<Select
|
||||
options={ENTERPRISE_SCALE_OPTIONS.map((o) => ({
|
||||
label: o.label,
|
||||
value: o.label,
|
||||
}))}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
@ -382,4 +511,7 @@ function OrgAccountPage(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ORG_INFO], true)(AntdTableFuncControl(OrgAccountPage));
|
||||
export default Connect(
|
||||
[NS_ORG_INFO],
|
||||
true,
|
||||
)(AntdTableFuncControl(OrgAccountPage));
|
||||
|
|
|
|||
Loading…
Reference in New Issue