Compare commits
No commits in common. "c046210d809e0c70ea605b42d6930d92c8ba1320" and "101d87c98faa945705bb81af43d70809c859d8f0" have entirely different histories.
c046210d80
...
101d87c98f
|
|
@ -85,13 +85,14 @@ function OrgAccountPage(props) {
|
||||||
message.success("操作成功");
|
message.success("操作成功");
|
||||||
await getData();
|
await getData();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
message.error(res?.message || "操作失败");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onResetPassword = (record) => {
|
const onResetPassword = (record) => {
|
||||||
console.log(record);
|
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: "重置密码",
|
title: "重置密码",
|
||||||
content: (
|
content: (
|
||||||
|
|
@ -107,11 +108,13 @@ function OrgAccountPage(props) {
|
||||||
okText: "确认重置",
|
okText: "确认重置",
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const res = await props.orgAccountResetPassword({ data: record.id });
|
const res = await props.orgAccountResetPassword({ id: record.id });
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
message.success("密码已重置");
|
message.success("密码已重置");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
message.error(res?.message || "重置失败");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -133,12 +136,14 @@ function OrgAccountPage(props) {
|
||||||
okButtonProps: { danger: true },
|
okButtonProps: { danger: true },
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const res = await props.orgAccountDelete({ data: record.id });
|
const res = await props.orgAccountDelete({ id: record.id });
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
await getData();
|
await getData();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
message.error(res?.message || "删除失败");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -160,7 +165,9 @@ function OrgAccountPage(props) {
|
||||||
editForm.resetFields();
|
editForm.resetFields();
|
||||||
await getData();
|
await getData();
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
message.error(res?.message || "保存失败");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,5 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import {
|
import { Button, Descriptions, Form, Input, message, Modal, Select, Table } from "antd";
|
||||||
Button,
|
|
||||||
Descriptions,
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
message,
|
|
||||||
Modal,
|
|
||||||
Select,
|
|
||||||
Table,
|
|
||||||
} from "antd";
|
|
||||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||||
|
|
@ -18,7 +9,6 @@ import { tools } from "@cqsjjb/jjb-common-lib";
|
||||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||||
import { NS_QUAL_EXPERT } from "~/enumerate/namespace";
|
import { NS_QUAL_EXPERT } from "~/enumerate/namespace";
|
||||||
import { GENDER_OPTIONS, GENDER_MAP } from "~/enumerate/constant";
|
import { GENDER_OPTIONS, GENDER_MAP } from "~/enumerate/constant";
|
||||||
import AttachmentUpload from "~/components/AttachmentUpload";
|
|
||||||
|
|
||||||
const { router } = tools;
|
const { router } = tools;
|
||||||
|
|
||||||
|
|
@ -30,21 +20,8 @@ const ExperManage = (props) => {
|
||||||
const [editingId, setEditingId] = useState(null);
|
const [editingId, setEditingId] = useState(null);
|
||||||
const [submiting, setSubmiting] = useState(false);
|
const [submiting, setSubmiting] = useState(false);
|
||||||
|
|
||||||
const {
|
const { qualExpert, queryExpertPage, getExpertDetail, saveExpert, modifyExpert, deleteExpert } = props;
|
||||||
qualExpert,
|
const { qualExpertList, qualExpertTotal, qualExpertLoading, qualExpertDetail, qualExpertDetailLoading } = qualExpert || {};
|
||||||
queryExpertPage,
|
|
||||||
getExpertDetail,
|
|
||||||
saveExpert,
|
|
||||||
modifyExpert,
|
|
||||||
deleteExpert,
|
|
||||||
} = props;
|
|
||||||
const {
|
|
||||||
qualExpertList,
|
|
||||||
qualExpertTotal,
|
|
||||||
qualExpertLoading,
|
|
||||||
qualExpertDetail,
|
|
||||||
qualExpertDetailLoading,
|
|
||||||
} = qualExpert || {};
|
|
||||||
|
|
||||||
const getData = () => {
|
const getData = () => {
|
||||||
queryExpertPage({
|
queryExpertPage({
|
||||||
|
|
@ -89,11 +66,7 @@ const ExperManage = (props) => {
|
||||||
setEditVisible(true);
|
setEditVisible(true);
|
||||||
const res = await getExpertDetail({ id });
|
const res = await getExpertDetail({ id });
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
const params = res.data;
|
editForm.setFieldsValue(res.data || qualExpertDetail);
|
||||||
if (params.certificate) {
|
|
||||||
params.certificate = JSON.parse(params.certificate);
|
|
||||||
}
|
|
||||||
editForm.setFieldsValue(params);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -102,9 +75,6 @@ const ExperManage = (props) => {
|
||||||
setSubmiting(true);
|
setSubmiting(true);
|
||||||
const action = editingId ? modifyExpert : saveExpert;
|
const action = editingId ? modifyExpert : saveExpert;
|
||||||
const params = editingId ? { ...values, id: editingId } : values;
|
const params = editingId ? { ...values, id: editingId } : values;
|
||||||
if (values.certificate) {
|
|
||||||
params.certificate = JSON.stringify(values.certificate);
|
|
||||||
}
|
|
||||||
const res = await action(params);
|
const res = await action(params);
|
||||||
setSubmiting(false);
|
setSubmiting(false);
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
|
|
@ -124,7 +94,7 @@ const ExperManage = (props) => {
|
||||||
okButtonProps: { danger: true },
|
okButtonProps: { danger: true },
|
||||||
cancelText: "取消",
|
cancelText: "取消",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const res = await deleteExpert({ data: record.id });
|
const res = await deleteExpert({ id: record.id });
|
||||||
if (res?.success !== false) {
|
if (res?.success !== false) {
|
||||||
message.success("删除成功");
|
message.success("删除成功");
|
||||||
getData();
|
getData();
|
||||||
|
|
@ -151,31 +121,16 @@ const ExperManage = (props) => {
|
||||||
render: (code) => GENDER_MAP[code] || "--",
|
render: (code) => GENDER_MAP[code] || "--",
|
||||||
},
|
},
|
||||||
{ title: "身份证号", dataIndex: "idCardNo", width: 180 },
|
{ title: "身份证号", dataIndex: "idCardNo", width: 180 },
|
||||||
|
{ title: "证书", dataIndex: "certificate", width: 120, ellipsis: true },
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
width: 180,
|
width: 180,
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
render: (_, record) => (
|
render: (_, record) => (
|
||||||
<TableAction>
|
<TableAction>
|
||||||
<Button
|
<Button type="link" size="small" onClick={() => openDetail(record.id)}>查看</Button>
|
||||||
type="link"
|
<Button type="link" size="small" onClick={() => openEdit(record.id)}>编辑</Button>
|
||||||
size="small"
|
<Button type="link" size="small" danger onClick={() => handleDelete(record)}>删除</Button>
|
||||||
onClick={() => openDetail(record.id)}
|
|
||||||
>
|
|
||||||
查看
|
|
||||||
</Button>
|
|
||||||
<Button type="link" size="small" onClick={() => openEdit(record.id)}>
|
|
||||||
编辑
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
size="small"
|
|
||||||
danger
|
|
||||||
onClick={() => handleDelete(record)}
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</Button>
|
|
||||||
</TableAction>
|
</TableAction>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
@ -185,9 +140,7 @@ const ExperManage = (props) => {
|
||||||
<PageLayout
|
<PageLayout
|
||||||
title="专家管理"
|
title="专家管理"
|
||||||
extra={
|
extra={
|
||||||
<Button type="primary" onClick={openAdd}>
|
<Button type="primary" onClick={openAdd}>新增专家</Button>
|
||||||
新增专家
|
|
||||||
</Button>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<SearchForm
|
<SearchForm
|
||||||
|
|
@ -196,18 +149,10 @@ const ExperManage = (props) => {
|
||||||
loading={qualExpertLoading}
|
loading={qualExpertLoading}
|
||||||
formLine={[
|
formLine={[
|
||||||
<Form.Item key="userName" name="userName">
|
<Form.Item key="userName" name="userName">
|
||||||
<ControlWrapper.Input
|
<ControlWrapper.Input label="姓名" placeholder="请输入" allowClear />
|
||||||
label="姓名"
|
|
||||||
placeholder="请输入"
|
|
||||||
allowClear
|
|
||||||
/>
|
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="account" name="account">
|
<Form.Item key="account" name="account">
|
||||||
<ControlWrapper.Input
|
<ControlWrapper.Input label="账号" placeholder="请输入" allowClear />
|
||||||
label="账号"
|
|
||||||
placeholder="请输入"
|
|
||||||
allowClear
|
|
||||||
/>
|
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="genderCode" name="genderCode">
|
<Form.Item key="genderCode" name="genderCode">
|
||||||
<ControlWrapper.Select
|
<ControlWrapper.Select
|
||||||
|
|
@ -217,18 +162,12 @@ const ExperManage = (props) => {
|
||||||
style={{ width: "100%" }}
|
style={{ width: "100%" }}
|
||||||
>
|
>
|
||||||
{GENDER_OPTIONS.map((item) => (
|
{GENDER_OPTIONS.map((item) => (
|
||||||
<Select.Option key={item.value} value={item.value}>
|
<Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
|
||||||
{item.label}
|
|
||||||
</Select.Option>
|
|
||||||
))}
|
))}
|
||||||
</ControlWrapper.Select>
|
</ControlWrapper.Select>
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
<Form.Item key="idCardNo" name="idCardNo">
|
<Form.Item key="idCardNo" name="idCardNo">
|
||||||
<ControlWrapper.Input
|
<ControlWrapper.Input label="身份证号" placeholder="请输入" allowClear />
|
||||||
label="身份证号"
|
|
||||||
placeholder="请输入"
|
|
||||||
allowClear
|
|
||||||
/>
|
|
||||||
</Form.Item>,
|
</Form.Item>,
|
||||||
]}
|
]}
|
||||||
onReset={handleReset}
|
onReset={handleReset}
|
||||||
|
|
@ -271,31 +210,12 @@ const ExperManage = (props) => {
|
||||||
footer={<Button onClick={() => setDetailVisible(false)}>关闭</Button>}
|
footer={<Button onClick={() => setDetailVisible(false)}>关闭</Button>}
|
||||||
width={560}
|
width={560}
|
||||||
>
|
>
|
||||||
<Descriptions
|
<Descriptions column={2} bordered size="small" loading={qualExpertDetailLoading}>
|
||||||
column={2}
|
<Descriptions.Item label="姓名">{qualExpertDetail?.userName || "--"}</Descriptions.Item>
|
||||||
bordered
|
<Descriptions.Item label="账号">{qualExpertDetail?.account || "--"}</Descriptions.Item>
|
||||||
size="small"
|
<Descriptions.Item label="性别">{GENDER_MAP[qualExpertDetail?.genderCode] || "--"}</Descriptions.Item>
|
||||||
loading={qualExpertDetailLoading}
|
<Descriptions.Item label="身份证号">{qualExpertDetail?.idCardNo || "--"}</Descriptions.Item>
|
||||||
>
|
<Descriptions.Item label="证书" span={2}>{qualExpertDetail?.certificate || "--"}</Descriptions.Item>
|
||||||
<Descriptions.Item label="姓名">
|
|
||||||
{qualExpertDetail?.userName || "--"}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="账号">
|
|
||||||
{qualExpertDetail?.account || "--"}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="性别">
|
|
||||||
{GENDER_MAP[qualExpertDetail?.genderCode] || "--"}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="身份证号">
|
|
||||||
{qualExpertDetail?.idCardNo || "--"}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="证书" span={2}>
|
|
||||||
{(qualExpertDetail?.certificate? JSON.parse(qualExpertDetail?.certificate): [])?.map((item) => (
|
|
||||||
<a key={item.id} href={item.url} target="_blank">
|
|
||||||
{item.name}
|
|
||||||
</a>
|
|
||||||
))}
|
|
||||||
</Descriptions.Item>
|
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
@ -309,40 +229,29 @@ const ExperManage = (props) => {
|
||||||
width={520}
|
width={520}
|
||||||
>
|
>
|
||||||
<Form form={editForm} layout="vertical">
|
<Form form={editForm} layout="vertical">
|
||||||
<Form.Item
|
<Form.Item name="userName" label="姓名" rules={[{ required: true, message: "请输入姓名" }]}>
|
||||||
name="userName"
|
|
||||||
label="姓名"
|
|
||||||
rules={[{ required: true, message: "请输入姓名" }]}
|
|
||||||
>
|
|
||||||
<Input placeholder="请输入" allowClear />
|
<Input placeholder="请输入" allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item name="account" label="账号" rules={[{ required: true, message: "请输入账号" }]}>
|
||||||
name="account"
|
|
||||||
label="账号"
|
|
||||||
rules={[{ required: true, message: "请输入账号" }]}
|
|
||||||
>
|
|
||||||
<Input placeholder="请输入" allowClear />
|
<Input placeholder="请输入" allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="genderCode" label="性别">
|
<Form.Item name="genderCode" label="性别">
|
||||||
<Select placeholder="请选择" allowClear style={{ width: "100%" }}>
|
<Select placeholder="请选择" allowClear style={{ width: "100%" }}>
|
||||||
{GENDER_OPTIONS.map((item) => (
|
{GENDER_OPTIONS.map((item) => (
|
||||||
<Select.Option key={item.value} value={item.value}>
|
<Select.Option key={item.value} value={item.value}>{item.label}</Select.Option>
|
||||||
{item.label}
|
|
||||||
</Select.Option>
|
|
||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="idCardNo" label="身份证号">
|
<Form.Item name="idCardNo" label="身份证号">
|
||||||
<Input placeholder="请输入" allowClear />
|
<Input placeholder="请输入" allowClear />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<AttachmentUpload name="certificate" maxCount={1} label="证书" />
|
<Form.Item name="certificate" label="证书">
|
||||||
|
<Input placeholder="请输入" allowClear />
|
||||||
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Connect(
|
export default Connect([NS_QUAL_EXPERT], true)(AntdTableFuncControl(ExperManage));
|
||||||
[NS_QUAL_EXPERT],
|
|
||||||
true,
|
|
||||||
)(AntdTableFuncControl(ExperManage));
|
|
||||||
|
|
@ -7,7 +7,6 @@
|
||||||
.micro-temp-modal-body {
|
.micro-temp-modal-body {
|
||||||
max-height: 630px;
|
max-height: 630px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
|
|
|
||||||
|
|
@ -39,17 +39,17 @@ export const orgAccountModify = declareRequest("orgInfoLoading", safeAction(asyn
|
||||||
return fromSingleResponse(res, toOrgInfoForm);
|
return fromSingleResponse(res, toOrgInfoForm);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const orgAccountDelete = declareRequest("orgInfoLoading", safeAction(async (data) => {
|
export const orgAccountDelete = declareRequest("orgInfoLoading", safeAction(async ({ id }) => {
|
||||||
return apiPost("/safetyEval/org-info/delete", data, {}, NO_ORG_CONTEXT);
|
return apiPostDelete("/safetyEval/org-info/delete", id, NO_ORG_CONTEXT);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const orgAccountUpdateState = declareRequest("orgInfoLoading", safeAction(async ({ id, state }) => {
|
export const orgAccountUpdateState = declareRequest("orgInfoLoading", safeAction(async ({ id, state }) => {
|
||||||
return apiPost("/safetyEval/org-info/update-state", { id, state }, {}, NO_ORG_CONTEXT);
|
return apiPost("/safetyEval/org-info/update-state", { id, state }, {}, NO_ORG_CONTEXT);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const orgAccountResetPassword = declareRequest("orgInfoLoading", safeAction(async (data ) => {
|
export const orgAccountResetPassword = declareRequest("orgInfoLoading", safeAction(async ({ id }) => {
|
||||||
const url = `/safetyEval/org-info/reset-password`;
|
const url = `/safetyEval/org-info/reset-password?id=${encodeURIComponent(id)}`;
|
||||||
return apiPost(url, data, {}, NO_ORG_CONTEXT);
|
return apiPost(url, {}, {}, NO_ORG_CONTEXT);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const registeredOrgList = declareRequest("orgInfoLoading", safePageResult(async (params) => {
|
export const registeredOrgList = declareRequest("orgInfoLoading", safePageResult(async (params) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue