Compare commits
3 Commits
85de5dcc2f
...
fda9237e0a
Author | SHA1 | Date | |
---|---|---|---|
fda9237e0a | |||
d6c3afdb96 | |||
8bdfa73c93 |
@ -33,35 +33,18 @@ const Config: React.FC<{}> = () => {
|
||||
roomType = getURLInformation("roomType");
|
||||
}
|
||||
//查评分办法和采购方式
|
||||
//TODO zyx假数据 start
|
||||
// getBizInfo(bizId).then((res) => {
|
||||
let methodT = false;
|
||||
// if (res.code == 200) {
|
||||
// const data = res.data;
|
||||
const data = {
|
||||
"createBy": "ex-wanghy623", "createDate": "2025-05-09 08:58:57",
|
||||
"updateBy": "ex-wanghy623", "updateDate": null, "tenantId": "ebtp_mall", "tenantName": "ebtp_mall", "deleteFlag": "normal",
|
||||
"lastUpdateTime": "2024-10-28 15:56:21", "id": "1920644626720436224", "projectId": "1920644626460389376",
|
||||
"bidSectBizNum": "ZX36102410002138", "bidSectCode": 1, "bidSectName": "测试001", "bidSectContent": null, "bidSectTypeDict": null,
|
||||
"bidSectContractPrice": 1000.00000, "contractPriceCurrencyDict": null, "selectionMethod": null, "reviewRules": null,
|
||||
"priceUnitDict": null, "bidderQual": null, "quotationMethodDict": "quotation_method_2", "tenderOpeningTime": null,
|
||||
"ptcpMode": null, "ptcpCount": null, "businessModule": 8, "status": 2, "attDatasetId": null, "checkMethodDict": null,
|
||||
"chooseProcess": "choose_process_4", "reviewReportId": null, "sectionNumber": null, "evalMethodDict": "eval_method_2",
|
||||
"procurementTypeDict": null, "miitSectionId": null, "monetaryUnit": null, "remarks": null, "parentSectionId": "1916736930678689792",
|
||||
"projectPlanId": "1850785019690168356", "subprojectId": "1850783951401635842", "isAnnouncement": null, "priceCeiling": 800.00000,
|
||||
"priceCeilingExplain": null, "isStructureQuote": "1", "structureQuoteModel": "003", "structureQuoteLimitType": "002",
|
||||
"bidNumberIsDefinite": "1", "projBidRatioInfoVoList": [], "bidDefiniteNumber": "2", "structureNote": null,
|
||||
"basePriceUnitLimit": null, "materialList": [], "purcModel": null, "preBidAnalysisFlag": 0, "quotePreResultFlag": "0"
|
||||
};
|
||||
//TODO zyx假数据 end
|
||||
if (roomType == '2') {
|
||||
data.evalMethodDict === 'eval_method_2' ? methodT = true : null;//评分办法 1最低价 2综合评估
|
||||
}
|
||||
data.ptcpMode === 'ptcp_mode_2' ? methodT = true : null;//采购方式 1合格制 2有限数量制
|
||||
// }
|
||||
methodSet(methodT);
|
||||
// });
|
||||
//TODO zyx假数据 end
|
||||
getBizInfo(bizId).then((res) => {
|
||||
let methodT = false;
|
||||
if (res.code == 200) {
|
||||
const data = res.data;
|
||||
console.log("data",data)
|
||||
if (roomType == '2') {
|
||||
data.evalMethodDict === 'eval_method_2' ? methodT = true : null;//评分办法 1最低价 2综合评估
|
||||
}
|
||||
data.ptcpMode === 'ptcp_mode_2' ? methodT = true : null;//采购方式 1合格制 2有限数量制
|
||||
}
|
||||
methodSet(methodT);
|
||||
});
|
||||
|
||||
}, [])
|
||||
return (
|
||||
|
@ -1,19 +1,24 @@
|
||||
import React, { useState, useRef, useMemo, useEffect } from 'react';
|
||||
import { message, Modal, Input, Form, PageHeader, Button, Spin, Tree, Checkbox, Row, Col, Upload } from 'antd';
|
||||
import { message, Modal, Input, Form, PageHeader, Button, Spin, Tree, Checkbox, Row, Col, Upload, TreeSelect } from 'antd';
|
||||
import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
|
||||
import tableProps from '@/utils/tableProps';
|
||||
import { getPage, getDataById, allocationIF, assignsRoles, updateRole } from './service';
|
||||
import { fetchAllDepartment } from '../Department/service';
|
||||
import { getDicData } from '@/utils/session';
|
||||
import { fetchIamUsers, syncIamUser } from './service';
|
||||
import { UploadOutlined, DownloadOutlined } from '@ant-design/icons';
|
||||
import { UploadOutlined, DownloadOutlined, EditOutlined } from '@ant-design/icons';
|
||||
const { Search } = Input;
|
||||
|
||||
const entrust: React.FC<{}> = () => {
|
||||
const [roleModalForm] = Form.useForm();
|
||||
const [editModalForm] = Form.useForm();
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
const [editOpen, setEditOpen] = useState<boolean>(false);
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [spin, spinSet] = useState<boolean>(false);
|
||||
const [roles, setRoles] = useState<any>([]);
|
||||
const [departments, setDepartments] = useState<any>([]);
|
||||
const [departmentTreeData, setDepartmentTreeData] = useState<any>([]);
|
||||
//查询分页数据
|
||||
const [pageData, pageDataSet] = useState<any>({
|
||||
pageNo: 1,
|
||||
@ -29,6 +34,8 @@ const entrust: React.FC<{}> = () => {
|
||||
const [iamTotal, setIamTotal] = useState(0);
|
||||
const [iamPage, setIamPage] = useState({ pageNo: 1, pageSize: 10 });
|
||||
const [iamSearch, setIamSearch] = useState('');
|
||||
const [currentUser, setCurrentUser] = useState<any>(null);
|
||||
|
||||
useEffect(() => {
|
||||
getDepartmentList();
|
||||
}, []);
|
||||
@ -42,15 +49,58 @@ const entrust: React.FC<{}> = () => {
|
||||
{ title: '部门', dataIndex: 'orgName', hideInSearch: true },
|
||||
{ title: '邮箱', dataIndex: 'email' },
|
||||
{
|
||||
title: '操作', width: '9%',
|
||||
title: '操作', width: '12%',
|
||||
valueType: 'option',
|
||||
render: (_, record) => [
|
||||
<Button type='text' onClick={() => { chooseRole(record) }}>分配角色</Button>
|
||||
// <Button type='text' onClick={() => { handleUpdate(record) }}>修改</Button>,
|
||||
// <Button type='text' onClick={() => { handleDelete(record.roleId) }}>删除</Button>
|
||||
<Button type='text' onClick={() => { chooseRole(record) }}>分配角色</Button>,
|
||||
<Button type='text' icon={<EditOutlined />} onClick={() => { handleEdit(record) }}>修改</Button>
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
// 处理修改用户
|
||||
const handleEdit = (record: any) => {
|
||||
setCurrentUser(record);
|
||||
editModalForm.resetFields();
|
||||
editModalForm.setFieldsValue({
|
||||
userId: record.userId,
|
||||
name: record.name,
|
||||
employeeNumber: record.employeeNumber,
|
||||
email: record.email,
|
||||
orgId: record.orgId,
|
||||
orgName: record.orgName
|
||||
});
|
||||
setEditOpen(true);
|
||||
};
|
||||
|
||||
// 关闭修改Modal
|
||||
const closeEditModal = () => {
|
||||
editModalForm.resetFields();
|
||||
setEditOpen(false);
|
||||
setCurrentUser(null);
|
||||
};
|
||||
|
||||
// 提交修改
|
||||
const onEditSubmit = async () => {
|
||||
try {
|
||||
const values = await editModalForm.validateFields();
|
||||
const { success } = await updateRole(values);
|
||||
if (success) {
|
||||
message.success('修改成功!');
|
||||
closeEditModal();
|
||||
actionRef.current?.reload();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 部门选择变化
|
||||
const handleDepartmentChange = (value: string, labelList: any) => {
|
||||
const selectedLabel = labelList[labelList.length - 1];
|
||||
editModalForm.setFieldsValue({ orgName: selectedLabel });
|
||||
};
|
||||
|
||||
//分配角色查询数据
|
||||
const chooseRole = (record: any) => {
|
||||
roleModalForm.resetFields();
|
||||
@ -89,6 +139,68 @@ const entrust: React.FC<{}> = () => {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
|
||||
// 修改用户Modal
|
||||
const editUserModal = (
|
||||
<Modal
|
||||
title="修改用户信息"
|
||||
visible={editOpen}
|
||||
width="50%"
|
||||
centered
|
||||
destroyOnClose={true}
|
||||
onOk={onEditSubmit}
|
||||
onCancel={closeEditModal}
|
||||
>
|
||||
<Form form={editModalForm} {...layout}>
|
||||
<Form.Item label="用户ID" name="userId" hidden>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="用户名"
|
||||
name="name"
|
||||
rules={[{ required: true, message: '请输入用户名' }]}
|
||||
>
|
||||
<Input placeholder="请输入用户名" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="用户账号"
|
||||
name="employeeNumber"
|
||||
rules={[{ required: true, message: '请输入用户账号' }]}
|
||||
>
|
||||
<Input placeholder="请输入用户账号" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="邮箱"
|
||||
name="email"
|
||||
rules={[
|
||||
{ type: 'email', message: '请输入正确的邮箱格式' },
|
||||
{ required: true, message: '请输入邮箱' }
|
||||
]}
|
||||
>
|
||||
<Input placeholder="请输入邮箱" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="部门"
|
||||
name="orgId"
|
||||
rules={[{ required: true, message: '请选择部门' }]}
|
||||
>
|
||||
<TreeSelect
|
||||
placeholder="请选择部门"
|
||||
treeData={departmentTreeData}
|
||||
onChange={handleDepartmentChange}
|
||||
showSearch
|
||||
treeNodeFilterProp="title"
|
||||
allowClear
|
||||
treeDefaultExpandAll
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="部门名称" name="orgName" hidden>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
|
||||
const setRoleModal = (
|
||||
<Modal
|
||||
title={"分配角色"}
|
||||
@ -168,6 +280,8 @@ const entrust: React.FC<{}> = () => {
|
||||
};
|
||||
generateList(data);
|
||||
treeDataListSet(dataList);
|
||||
setDepartments(dataList);
|
||||
setDepartmentTreeData(data);
|
||||
} catch (e) { }
|
||||
};
|
||||
|
||||
@ -354,6 +468,7 @@ const entrust: React.FC<{}> = () => {
|
||||
onReset={() => { pageDataSet({ pageNo: 1, pageSize: 10 }); setOrgId(''); }}
|
||||
/>
|
||||
{setRoleModal}
|
||||
{editUserModal}
|
||||
{/* IAM用户同步Modal */}
|
||||
<Modal
|
||||
title="同步用户信息"
|
||||
|
@ -455,7 +455,6 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
|
||||
const juryNumber = parseInt(uniqueJuryNumbers[0]) || 0;
|
||||
const repNumber = parseInt(form.getFieldValue('representativeNumber')) || 0;
|
||||
|
||||
|
||||
if (repNumber < 0 || repNumber > juryNumber) {
|
||||
message.error(`直接录入数量应在 0 ~ ${juryNumber} 之间`);
|
||||
@ -469,11 +468,11 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
};
|
||||
|
||||
// 在 useEffect 中监听依赖项
|
||||
useEffect(() => {
|
||||
if (Array.isArray(sections) && sections.length > 0) {
|
||||
calculateExpertNumber();
|
||||
}
|
||||
}, [form.getFieldValue('representativeNumber'), checkedList, sections]);
|
||||
// useEffect(() => {
|
||||
// if (Array.isArray(sections) && sections.length > 0) {
|
||||
// calculateExpertNumber();
|
||||
// }
|
||||
// }, [form.getFieldValue('representativeNumber'), checkedList, sections]);
|
||||
const tab1 = () => {//cqtab1
|
||||
return (
|
||||
<>
|
||||
@ -600,20 +599,7 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
rules={[...rule(`直接录入数量`), { pattern: /^([1-9]?\d|100)$/, message: '请输入正确数值' }]}
|
||||
{...formLayout}
|
||||
>
|
||||
<Input style={{ width: "90%" }} type="number" disabled={disabled} placeholder={`直接录入数量`}
|
||||
// onChange={(e) => {
|
||||
// const value = e.target.value;
|
||||
// if (value && !checkedList?.length) {
|
||||
// form.resetFields(['representativeNumber']);
|
||||
// message.error("请先选择关联标段");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 继续触发计算
|
||||
// form.setFieldsValue({ representativeNumber: value });
|
||||
// calculateExpertNumber();
|
||||
// }}
|
||||
/>
|
||||
<Input style={{ width: "90%" }} type="number" disabled={disabled} placeholder={`直接录入数量`}/>
|
||||
</FormItem></Col>
|
||||
<Col span={12}>
|
||||
<FormItem
|
||||
@ -622,7 +608,7 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
rules={[...rule('抽取数量'), { pattern: /^([1-9]?\d|100)$/, message: '请输入正确数值' }]}
|
||||
{...formLayout}
|
||||
>
|
||||
<Input style={{ width: "90%" }} type="number" />
|
||||
<Input style={{ width: "90%" }} type="number" disabled={disabled} placeholder={`专家抽取数量`} />
|
||||
</FormItem>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
@ -668,13 +654,6 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
}}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{/* <Col span={12}><FormItem
|
||||
name="description"
|
||||
label="申请要求"
|
||||
rules={[{ type: 'string', message: '请输入正确内容' }, { max: 100, message: '内容超长' }]}
|
||||
>
|
||||
<Input style={{ width: "90%" }} disabled={disabled} />
|
||||
</FormItem></Col> */}
|
||||
</Row>
|
||||
</Form>
|
||||
</>
|
||||
@ -698,13 +677,16 @@ const JudgingPanel: React.FC<{}> = () => {
|
||||
valueType: 'select',
|
||||
valueEnum: professionalMap,
|
||||
width: '30%',
|
||||
fieldProps: {
|
||||
disabled: disabled // 查看时禁用选择
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '人数',
|
||||
dataIndex: 'extractNumber',
|
||||
width: '30%',
|
||||
renderFormItem: (_, { record }) => {
|
||||
return <InputNumber min={0} addonAfter="人" />;
|
||||
return <InputNumber min={0} addonAfter="人" disabled={disabled} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user