更新部分功能
This commit is contained in:
@ -4,6 +4,7 @@ import { RightOutlined, LeftOutlined } from '@ant-design/icons';
|
||||
import { coscoSupplierBase } from '../services';
|
||||
|
||||
const { Option } = Select;
|
||||
type OptionType = { label: string; value: string };
|
||||
|
||||
const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSelect?: (selected: any[]) => void; }> = ({ visible, onCancel, onSelect }) => {
|
||||
// 查询
|
||||
@ -20,6 +21,8 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
const [rightSelected, setRightSelected] = useState<React.Key[]>([]);
|
||||
//确认 已选供应商
|
||||
const [chosenSuppliers, setChosenSuppliers] = useState<any[]>([]);
|
||||
// 境内/境外下拉数据
|
||||
const [regionOptions, setRegionOptions] = useState<OptionType[]>([]);
|
||||
//已选供应商 去重
|
||||
const filteredData = (chosenSuppliers:any, selected:any) => {
|
||||
const ids = new Set(chosenSuppliers.map((item:any) => item.id));
|
||||
@ -56,6 +59,11 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
// 初始化
|
||||
useEffect(() => {
|
||||
if(visible) {
|
||||
// 境内/境外 下拉
|
||||
setRegionOptions([
|
||||
{ label: '境内企业', value: 'dvs' },
|
||||
{ label: '境外企业', value: 'ovs' },
|
||||
])
|
||||
const values = form.getFieldsValue();
|
||||
getTableList(values,1 , 10)
|
||||
}
|
||||
@ -73,20 +81,25 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
<Modal title="选择供应商" visible={visible} onCancel={onCancel} footer={null} width="80%">
|
||||
|
||||
<Form layout="inline" form={form} onFinish={getTableList} style={{ marginBottom: 16 }}>
|
||||
<Form.Item name="accessType" label="供应商名称">
|
||||
<Input placeholder="供应商名称" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptId" label="境内/境外">
|
||||
<Select placeholder="境内/境外" allowClear >
|
||||
<Option value="境内">境内</Option>
|
||||
<Option value="境外">境外</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称关键字" style={{ width: 220 }} allowClear maxLength={20} />
|
||||
</Form.Item>
|
||||
<Form.Item name="supplierType" label="境内/境外">
|
||||
<Select style={{ width: 160 }} placeholder="请选择境内/境外" allowClear>
|
||||
{regionOptions.map(opt => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={() => form.resetFields()}>重置</Button>
|
||||
<Button onClick={() => {
|
||||
form.resetFields()
|
||||
const values = form.getFieldsValue();
|
||||
getTableList(values,1 , 10)
|
||||
}}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
|
@ -4,7 +4,7 @@ import { RightOutlined, LeftOutlined } from '@ant-design/icons';
|
||||
import { coscoSupplierBase } from '../services';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
type OptionType = { label: string; value: string };
|
||||
const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSelect?: (selected: any[]) => void; }> = ({ visible, onCancel, onSelect }) => {
|
||||
// 查询
|
||||
const [form] = Form.useForm();
|
||||
@ -20,6 +20,8 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
const [rightSelected, setRightSelected] = useState<React.Key[]>([]);
|
||||
//确认 已选供应商
|
||||
const [chosenSuppliers, setChosenSuppliers] = useState<any[]>([]);
|
||||
// 境内/境外下拉数据
|
||||
const [regionOptions, setRegionOptions] = useState<OptionType[]>([]);
|
||||
//已选供应商 去重
|
||||
const filteredData = (chosenSuppliers:any, selected:any) => {
|
||||
const ids = new Set(chosenSuppliers.map((item:any) => item.id));
|
||||
@ -55,9 +57,16 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
};
|
||||
// 初始化
|
||||
useEffect(() => {
|
||||
const values = form.getFieldsValue();
|
||||
getTableList(values,1 , 10)
|
||||
}, [])
|
||||
if(visible) {
|
||||
// 境内/境外 下拉
|
||||
setRegionOptions([
|
||||
{ label: '境内企业', value: 'dvs' },
|
||||
{ label: '境外企业', value: 'ovs' },
|
||||
])
|
||||
const values = form.getFieldsValue();
|
||||
getTableList(values,1 , 10)
|
||||
}
|
||||
}, [visible])
|
||||
//供应商名称
|
||||
const columns = [
|
||||
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, render: (name: string) => (
|
||||
@ -71,20 +80,28 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
|
||||
<Modal title="选择供应商" visible={visible} onCancel={onCancel} footer={null} width="80%">
|
||||
|
||||
<Form layout="inline" form={form} onFinish={getTableList} style={{ marginBottom: 16 }}>
|
||||
<Form.Item name="accessType" label="供应商名称">
|
||||
<Input placeholder="供应商名称" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item name="deptId" label="境内/境外">
|
||||
<Select placeholder="境内/境外" allowClear >
|
||||
<Option value="境内">境内</Option>
|
||||
<Option value="境外">境外</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Input placeholder="请输入供应商名称关键字" style={{ width: 220 }} allowClear maxLength={20} />
|
||||
</Form.Item>
|
||||
<Form.Item name="supplierType" label="境内/境外">
|
||||
<Select style={{ width: 160 }} placeholder="请选择境内/境外" allowClear>
|
||||
{regionOptions.map(opt => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item>
|
||||
<Button type="primary" htmlType="submit">查询</Button>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button onClick={() => form.resetFields()}>重置</Button>
|
||||
<Button onClick={() => {
|
||||
form.resetFields()
|
||||
const values = form.getFieldsValue();
|
||||
getTableList(values,1 , 10)
|
||||
}}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
|
@ -116,11 +116,12 @@ const GroupLeaderModal: React.FC<GroupLeaderModalProps> = ({
|
||||
accessWorkId = record?.id
|
||||
}
|
||||
|
||||
if(summaryParams.length === 0) {
|
||||
message.warning('请选择审核');
|
||||
return
|
||||
for (let index = 0; index < summaryParams.length; index++) {
|
||||
if(summaryParams[index].reviewResult === null) {
|
||||
message.warning('有未评审项');
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
update({ coscoAccessUserItemList: summaryParams, accessWorkId }).then((res: any) => {
|
||||
if (res.code === 200) {
|
||||
message.success('提交成功');
|
||||
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||
import { Modal, Table, Button, Radio, Input, Upload, message, Spin } from 'antd';
|
||||
import { reviewInfo, uploadFile, update } from '../services';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { connect } from 'umi';
|
||||
//主体参数接口
|
||||
interface ResultModalProps {
|
||||
visible: boolean;
|
||||
@ -9,6 +10,7 @@ interface ResultModalProps {
|
||||
record?: { id?: string; [key: string]: any } | null;
|
||||
onCancel: () => void;
|
||||
onSubmit: () => void;
|
||||
dispatch: any;
|
||||
}
|
||||
interface RowData {
|
||||
key: string;
|
||||
@ -58,7 +60,8 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
view,
|
||||
record,
|
||||
onCancel,
|
||||
onSubmit
|
||||
onSubmit,
|
||||
dispatch,
|
||||
}) => {
|
||||
// type: 'teamMembers' | 'groupLeader'
|
||||
// 供应商、评审项、单元格数据
|
||||
@ -219,6 +222,13 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
if(record?.id) {
|
||||
accessWorkId = record?.id
|
||||
}
|
||||
|
||||
for (let index = 0; index < result.length; index++) {
|
||||
if(result[index].reviewResult === null) {
|
||||
message.warning('有未评审项');
|
||||
return
|
||||
}
|
||||
}
|
||||
// 提交审核
|
||||
update( {coscoAccessUserItemList: result, accessWorkId }).then((res) => {
|
||||
if(res.code == 200) {
|
||||
@ -238,7 +248,22 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
fixed: 'left'
|
||||
},
|
||||
...suppliers.map((sup, colIdx) => ({
|
||||
title: sup.supplierName,
|
||||
title: (
|
||||
<div>
|
||||
<a
|
||||
onClick={() => {
|
||||
dispatch({
|
||||
type: 'globalModal/show',
|
||||
payload: {
|
||||
id: sup.supplierId,
|
||||
},
|
||||
});
|
||||
}}
|
||||
>
|
||||
{sup.supplierName}
|
||||
</a>
|
||||
</div>
|
||||
),
|
||||
dataIndex: sup.supplierId,
|
||||
key: sup.supplierId,
|
||||
width: 300,
|
||||
@ -365,4 +390,4 @@ const ResultModal: React.FC<ResultModalProps> = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ResultModal;
|
||||
export default connect()(ResultModal);
|
||||
|
@ -50,7 +50,7 @@ const CooperateEnterprise: React.FC = () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const values = searchForm.getFieldsValue();
|
||||
const { code, data } = await getPage({...params, ...values });
|
||||
const { code, data } = await getPage({...params, ...values});
|
||||
if (code === 200) {
|
||||
setData(data.records);
|
||||
setPagination({ current: params.pageNo, pageSize: params.pageSize, total: data.total });
|
||||
|
Reference in New Issue
Block a user