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