合并代码
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Modal, Table, Button, Select, Spin, message } from 'antd';
|
||||
import { reviewInfo, update } from '../services';
|
||||
|
||||
interface ResultModalProps {
|
||||
import { connect } from 'umi';
|
||||
interface GroupLeaderModalProps {
|
||||
visible: boolean;
|
||||
view: boolean;
|
||||
record?: { id?: string; [key: string]: any } | null;
|
||||
onCancel: () => void;
|
||||
onSubmit: () => void;
|
||||
dispatch: any;
|
||||
}
|
||||
|
||||
// 只读备注弹窗
|
||||
@ -40,12 +41,13 @@ const RemarkViewModal: React.FC<{
|
||||
</Modal>
|
||||
);
|
||||
|
||||
const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
|
||||
visible,
|
||||
record,
|
||||
view,
|
||||
onCancel,
|
||||
onSubmit,
|
||||
dispatch,
|
||||
}) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [suppliers, setSuppliers] = useState<any[]>([]);
|
||||
@ -72,7 +74,7 @@ const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
supplierList.forEach((sup: any) => {
|
||||
// summary 行
|
||||
const summaryItem = (sup.coscoAccessItemList || []).find((i: any) => i.itemType === 'summary');
|
||||
// summaryMap[sup.supplierId] = summaryItem?.reviewResult;
|
||||
// summaryMap[sup.supplierId] = summaryItem?.reviewResult;coscoAccessUserItemList
|
||||
summaryMap[sup.supplierId] = summaryItem.coscoAccessUserItemList[0]?.reviewResult;
|
||||
});
|
||||
setGroupSummaryResult(summaryMap);
|
||||
@ -102,7 +104,7 @@ const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
const summaryItem = (sup.coscoAccessItemList || []).find((i: any) => i.itemType === 'summary');
|
||||
if (!summaryItem) return null;
|
||||
return {
|
||||
id: summaryItem.id,
|
||||
id: summaryItem.coscoAccessUserItemList[0].id,
|
||||
reviewResult: groupSummaryResult[sup.supplierId],
|
||||
remark: '', // 可拓展
|
||||
coscoAccessTtemAttachments: undefined,
|
||||
@ -113,6 +115,12 @@ const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
if(record?.id) {
|
||||
accessWorkId = record?.id
|
||||
}
|
||||
|
||||
if(summaryParams.length === 0) {
|
||||
message.warning('请选择审核');
|
||||
return
|
||||
}
|
||||
return
|
||||
update({ coscoAccessUserItemList: summaryParams, accessWorkId }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
@ -144,7 +152,19 @@ const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
return {
|
||||
title: (
|
||||
<div>
|
||||
<div style={{ fontWeight: 600 }}>{sup.supplierName}</div>
|
||||
{/* <div style={{ fontWeight: 600 }}>{sup.supplierName}</div> */}
|
||||
<a
|
||||
onClick={() => {
|
||||
dispatch({
|
||||
type: 'globalModal/show',
|
||||
payload: {
|
||||
id: sup.supplierId,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{sup.supplierName}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
children: reviewers.map((reviewBy: string) => ({
|
||||
@ -281,4 +301,4 @@ const GroupLeaderModal: React.FC<ResultModalProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default GroupLeaderModal;
|
||||
export default connect()(GroupLeaderModal);
|
||||
|
@ -46,10 +46,11 @@ const CooperateEnterprise: React.FC = () => {
|
||||
};
|
||||
|
||||
// 列表数据
|
||||
const getList = async (params: { pageNo: number; pageSize: number; parentCode: string; }) => {
|
||||
const getList = async (params: { pageNo: number; pageSize: number;}) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data } = await getPage({...params });
|
||||
try {
|
||||
const values = searchForm.getFieldsValue();
|
||||
const { code, data } = await getPage({...params, ...values });
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination({ current: params.pageNo, pageSize: params.pageSize, total: data.total });
|
||||
@ -63,20 +64,18 @@ const CooperateEnterprise: React.FC = () => {
|
||||
|
||||
const handleReset = () => {
|
||||
searchForm.resetFields();
|
||||
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10, parentCode: '' });
|
||||
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10 });
|
||||
};
|
||||
|
||||
const handleSearch = (values: any) => {
|
||||
const { parentCode } = values;
|
||||
const handleSearch = () => {
|
||||
getList({
|
||||
pageNo: 1,
|
||||
pageSize: pagination.pageSize ?? 10,
|
||||
parentCode: parentCode || ''
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
getList({ pageNo: 1, pageSize: 10, parentCode: '' });
|
||||
getList({ pageNo: 1, pageSize: 10 });
|
||||
}, []);
|
||||
|
||||
const columns: ColumnsType<Data> = [
|
||||
@ -86,12 +85,13 @@ const CooperateEnterprise: React.FC = () => {
|
||||
key: 'index',
|
||||
width: 80,
|
||||
align: 'center',
|
||||
render: (_: any, __: any, index: number) => index + 1,
|
||||
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
|
||||
},
|
||||
{
|
||||
title: '准入工作',
|
||||
dataIndex: 'accessWorkName',
|
||||
key: 'accessWorkName',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '发起单位',
|
||||
@ -117,6 +117,7 @@ const CooperateEnterprise: React.FC = () => {
|
||||
title: '评审时间',
|
||||
dataIndex: 'createTime',
|
||||
key: 'createTime',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '评审状态',
|
||||
@ -126,7 +127,7 @@ const CooperateEnterprise: React.FC = () => {
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 120,
|
||||
width: 140,
|
||||
render: (_: any, record: any) => {
|
||||
// 已完成 3 、结果汇总中 2 、进行中1 、 未开始0
|
||||
// 显示评审 按钮
|
||||
@ -159,8 +160,8 @@ const CooperateEnterprise: React.FC = () => {
|
||||
onFinish={handleSearch}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
<Form.Item name="parentCode" label="准入工作">
|
||||
<Input placeholder="请输入准入工作" />
|
||||
<Form.Item name="accessWorkName" label="准入工作">
|
||||
<Input placeholder="请输入准入工作" allowClear maxLength={50} />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
||||
@ -178,7 +179,7 @@ const CooperateEnterprise: React.FC = () => {
|
||||
dataSource={data}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
onChange={(pagination) => getList({ pageNo: pagination.current!, pageSize: pagination.pageSize!, parentCode: '', })}
|
||||
onChange={(pagination) => getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })}
|
||||
/>
|
||||
{ modalInfo.type && modalInfo.type === 'teamMembers' && (
|
||||
<ResultModal
|
||||
|
@ -6,7 +6,7 @@ import request from '@/utils/request';
|
||||
interface getPageData {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
parentCode?: string;
|
||||
accessWorkName?: string;
|
||||
}
|
||||
export const getPage = (data: getPageData) => request.post('/coscoAccessWork/getPage', { data});
|
||||
/**
|
||||
|
Reference in New Issue
Block a user