更新版本库
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -4,46 +4,43 @@ import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
|
||||
import { PlusOutlined, EditOutlined, DeleteOutlined, UploadOutlined } from '@ant-design/icons';
|
||||
import styles from './firstStyles.less';
|
||||
import { getPage, saveData, delCategory, delDetail, saveTem, getTemPage, useTem, getTree, glFile, getGlfile, getAllFile } from './service'
|
||||
import { getURLInformation } from '@/utils/CommonUtils'
|
||||
|
||||
//新增、保存
|
||||
const save = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
try {
|
||||
await saveData({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
//保存模板
|
||||
const saveT = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
const hide = message.loading('正在保存');
|
||||
try {
|
||||
await saveTem({ ...fields });
|
||||
const success = await saveTem({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
if (success) {
|
||||
message.success('保存成功');
|
||||
return true;
|
||||
} else {
|
||||
message.error('保存失败');
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
message.error('保存失败请重试!');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
//保存关联文件
|
||||
const saveF = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
const hide = message.loading('正在关联');
|
||||
try {
|
||||
await glFile({ ...fields });
|
||||
const success = await glFile({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
if (success) {
|
||||
message.success('关联成功');
|
||||
return true;
|
||||
} else {
|
||||
message.error('关联失败');
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
message.error('关联失败请重试!');
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@ -51,10 +48,15 @@ const saveF = async (fields: any) => {
|
||||
const useT = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
try {
|
||||
await useTem({ ...fields });
|
||||
const success = await useTem({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
if (success) {
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
} else {
|
||||
message.error('配置失败');
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
@ -63,12 +65,17 @@ const useT = async (fields: any) => {
|
||||
};
|
||||
//删除类别
|
||||
const delCate = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
const hide = message.loading('正在删除');
|
||||
try {
|
||||
await delCategory({ ...fields });
|
||||
const success = await delCategory({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
if (success) {
|
||||
message.success('删除成功');
|
||||
return true;
|
||||
} else {
|
||||
message.error('删除失败');
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
@ -77,12 +84,17 @@ const delCate = async (fields: any) => {
|
||||
};
|
||||
//删除细则
|
||||
const delDet = async (fields: any) => {
|
||||
const hide = message.loading('正在配置');
|
||||
const hide = message.loading('正在删除');
|
||||
try {
|
||||
await delDetail({ ...fields });
|
||||
const success = await delDetail({ ...fields });
|
||||
hide();
|
||||
message.success('配置成功');
|
||||
return true;
|
||||
if (success) {
|
||||
message.success('删除成功');
|
||||
return true;
|
||||
} else {
|
||||
message.error('删除失败');
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
hide();
|
||||
message.error('配置失败请重试!');
|
||||
@ -90,23 +102,103 @@ const delDet = async (fields: any) => {
|
||||
}
|
||||
};
|
||||
const First: React.FC<{}> = () => {
|
||||
//根据评审室id和轮次数查应答文件格式
|
||||
const [childs, childsSet] = useState<any>([]);//子节点
|
||||
const [roots, rootsSet] = useState<any>([]);//根节点
|
||||
const [pIds, pIdsSet] = useState<any>([]);//根节点(保存时用)
|
||||
const getTreeData = () => {
|
||||
getTree({ assessRoomId: assessRoomId, turnSort: turnSort }).then((res) => {
|
||||
let data: any = [];
|
||||
let rootT: any = [];
|
||||
let childT: any = [];
|
||||
if (res.data != undefined) {
|
||||
res.data.map((item: any, index: any) => {
|
||||
const title1 = item.name;
|
||||
const key1 = item.id;
|
||||
let children1: any = [];
|
||||
if (item.children != undefined) {
|
||||
const children = item.children.map((item: any, index: any) => {
|
||||
const title2 = item.name;
|
||||
const key2 = item.id;
|
||||
let children2: any = [];
|
||||
if (item.children != undefined) {
|
||||
const children = item.children.map((item: any, index: any) => {
|
||||
const title3 = item.name;
|
||||
const key3 = item.id;
|
||||
childT.push(key3)
|
||||
return { title: title3, key: key3, pId: key2 }
|
||||
});
|
||||
children2 = children;
|
||||
}
|
||||
childT.push(key2)
|
||||
return { title: title2, key: key2, children: children2, pId: key1 }
|
||||
});
|
||||
children1 = children;
|
||||
}
|
||||
const first = { title: title1, key: key1, children: children1, pId: null }
|
||||
rootT.push(key1)
|
||||
data.push(first);
|
||||
});
|
||||
}
|
||||
rootsSet(rootT);
|
||||
childsSet(childT);
|
||||
setTreeData(data);
|
||||
setSpin(false);
|
||||
})
|
||||
}
|
||||
//获取关联的文件用来选中
|
||||
const getGlFile = async (detailId: any) => {
|
||||
let data: any = [];
|
||||
await getGlfile({ detailId: detailId }).then((res) => {
|
||||
if (res.data != undefined) {
|
||||
res.data.map((it: any) => {
|
||||
//如果是子节点的 追加
|
||||
let index = childs.findIndex((item: any) => item === it.documentId);
|
||||
index != -1 ? data.push(it.documentId) : null;
|
||||
// data.push(item.documentId)
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
setCheckedKeys(data);
|
||||
setGlfile(true);
|
||||
setSpin(false);
|
||||
}
|
||||
//树
|
||||
const onCheck = (checkedKeys: any, e: { checked: boolean, checkedNodes: any, node: any, event: any, halfCheckedKeys: any }) => {
|
||||
// console.log('checkedKeys', checkedKeys);
|
||||
// console.log('checked', e.checked);
|
||||
// console.log('node', e.node);
|
||||
let pIdsT = [...pIds];
|
||||
let index = pIdsT.findIndex(item => item === e.node.pId);
|
||||
if (e.checked) {//选中
|
||||
//pids加根节点 有就不加
|
||||
if (e.node.pId != null) {//!=null为子节点
|
||||
pIdsT.push(e.node.pId);
|
||||
}
|
||||
} else {//取消选中
|
||||
//pids删根节点
|
||||
if (e.node.pId != null) {//!=null为子节点
|
||||
if (index != -1) {//-1 没有
|
||||
pIdsT.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
pIdsSet(pIdsT);
|
||||
setCheckedKeys(checkedKeys);
|
||||
};
|
||||
useEffect(() => {
|
||||
queryFirstData();
|
||||
}, []);
|
||||
function getQueryString(name: any) {
|
||||
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
let r = window.location.search.substr(1).match(reg);
|
||||
return r !== null ? unescape(r[2]) : null;
|
||||
}
|
||||
//获取初审数据
|
||||
const queryFirstData = () => {
|
||||
const queryFirstData = async () => {
|
||||
let commonId: any = "";
|
||||
if (getQueryString("id") != null) {
|
||||
commonId = getQueryString("id")
|
||||
if (getURLInformation("id") != null) {
|
||||
commonId = getURLInformation("id")
|
||||
}
|
||||
let nodeId: any = '';
|
||||
if (getQueryString("nodeId") != null) {
|
||||
nodeId = getQueryString("nodeId")
|
||||
if (getURLInformation("nodeId") != null) {
|
||||
nodeId = getURLInformation("nodeId")
|
||||
}
|
||||
const rvwType = 1;
|
||||
let type1: any, type2: any, type3: any, type4: any = false;
|
||||
@ -118,12 +210,11 @@ const First: React.FC<{}> = () => {
|
||||
let firstId = "";
|
||||
let assessRoomId: any, turnSort: any = 0;
|
||||
|
||||
getPage({ commonId, rvwType, nodeId }).then((res) => {
|
||||
console.log(res);
|
||||
await getPage({ commonId, rvwType, nodeId }).then((res) => {
|
||||
if (res.data != undefined) {
|
||||
const data = res.data;
|
||||
deviatedStatus = data.deviatedStatus;
|
||||
principleStatus = data.principleStatus;
|
||||
deviatedStatus = data.deviatedStatus != null ? data.deviatedStatus : 0;
|
||||
principleStatus = data.principleStatus != null ? data.principleStatus : 0;
|
||||
deviationNumber = data.deviationNumber;
|
||||
assessRoomId = data.assessRoomId;
|
||||
turnSort = data.reviewTurnSort;
|
||||
@ -159,12 +250,11 @@ const First: React.FC<{}> = () => {
|
||||
setDis(dis);
|
||||
setSpin(false);
|
||||
})
|
||||
}
|
||||
//根据评审室id和轮次数查应答文件格式
|
||||
const getTreeData = () => {
|
||||
getTree({ assessRoomId: assessRoomId, turnSort: turnSort }).then((res) => {
|
||||
console.log(res.data);
|
||||
|
||||
await getTree({ assessRoomId: assessRoomId, turnSort: turnSort }).then((res) => {
|
||||
let data: any = [];
|
||||
let rootT: any = [];
|
||||
let childT: any = [];
|
||||
if (res.data != undefined) {
|
||||
res.data.map((item: any, index: any) => {
|
||||
const title1 = item.name;
|
||||
@ -179,36 +269,28 @@ const First: React.FC<{}> = () => {
|
||||
const children = item.children.map((item: any, index: any) => {
|
||||
const title3 = item.name;
|
||||
const key3 = item.id;
|
||||
return { title: title3, key: key3 }
|
||||
childT.push(key3)
|
||||
return { title: title3, key: key3, pId: key2 }
|
||||
});
|
||||
children2 = children;
|
||||
}
|
||||
return { title: title2, key: key2, children: children2 }
|
||||
childT.push(key2)
|
||||
return { title: title2, key: key2, children: children2, pId: key1 }
|
||||
});
|
||||
children1 = children;
|
||||
}
|
||||
const first = { title: title1, key: key1, children: children1 }
|
||||
const first = { title: title1, key: key1, children: children1, pId: null }
|
||||
rootT.push(key1)
|
||||
data.push(first);
|
||||
});
|
||||
}
|
||||
rootsSet(rootT);
|
||||
childsSet(childT);
|
||||
setTreeData(data);
|
||||
setSpin(false);
|
||||
})
|
||||
}
|
||||
//获取关联的文件用来选中
|
||||
const getGlFile = (detailId: any) => {
|
||||
getGlfile({ detailId: detailId }).then((res) => {
|
||||
console.log(res.data);
|
||||
let data: any = [];
|
||||
if (res.data != undefined) {
|
||||
res.data.map((item: any) => {
|
||||
data.push(item.documentId);
|
||||
});
|
||||
}
|
||||
setCheckedKeys(data);
|
||||
setSpin(false);
|
||||
});
|
||||
}
|
||||
|
||||
//变量
|
||||
const formLayout = {
|
||||
labelCol: { span: 6 },
|
||||
@ -220,6 +302,7 @@ const First: React.FC<{}> = () => {
|
||||
const { Option } = Select;
|
||||
//控制
|
||||
const ref = useRef<ActionType>();
|
||||
const checkRelationRef = useRef<ActionType>();
|
||||
const [top] = useState(0);//固钉
|
||||
const [spin, setSpin] = useState<boolean>(false);//加载
|
||||
const [dis, setDis] = useState<boolean>(true);//是否可以更改
|
||||
@ -233,7 +316,6 @@ const First: React.FC<{}> = () => {
|
||||
const [glfile, setGlfile] = useState<boolean>(false);//关联应答文件
|
||||
const [checkRelation, setCheckRelation] = useState<boolean>(false); //查看关联应答文件
|
||||
const [checkedKeys, setCheckedKeys] = useState<string[]>([]);//树被选中节点
|
||||
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);//
|
||||
const [treeData, setTreeData] = useState<any>([]);//应答文件树
|
||||
const [choosedId, setChoosedId] = useState<any>();//关联应答文件的对应的一条数据的id
|
||||
//预览
|
||||
@ -266,7 +348,7 @@ const First: React.FC<{}> = () => {
|
||||
const [data2, setData2] = useState<any>([{}]);
|
||||
const [data3, setData3] = useState<any>([{}]);
|
||||
const [data4, setData4] = useState<any>([{}]);
|
||||
const [principleStatus, setPrincipleStatus] = useState<number>(0);//评判原则
|
||||
const [principleStatus, setPrincipleStatus] = useState<number>();//评判原则
|
||||
const [deviatedStatus, setDeviatedStatus] = useState<any>();//偏离
|
||||
const [deviationNumber, setDeviationNumber] = useState<any>();//偏离数量
|
||||
//标段列表表格
|
||||
@ -302,7 +384,7 @@ const First: React.FC<{}> = () => {
|
||||
title: '初审项性质', dataIndex: 'deviationStatus', width: 200,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Radio.Group disabled={dis} onChange={(event) => {
|
||||
<Radio.Group disabled={dis || deviatedStatus == 0} onChange={(event) => {
|
||||
const value = event.target.value;
|
||||
if (value != undefined) {
|
||||
const data = [...data1];
|
||||
@ -326,12 +408,10 @@ const First: React.FC<{}> = () => {
|
||||
<>
|
||||
{
|
||||
record.id != undefined ? <>
|
||||
<a type="primary" onClick={() => {
|
||||
<a type="primary" onClick={async () => {
|
||||
setSpin(true);
|
||||
treeData.length == 0 ? getTreeData() : null;
|
||||
setChoosedId(record.id);
|
||||
getGlFile(record.id);
|
||||
setGlfile(true);
|
||||
await getGlFile(record.id);
|
||||
}}>关联投标资料</a>
|
||||
<Divider type="vertical" /></>
|
||||
: null
|
||||
@ -389,7 +469,7 @@ const First: React.FC<{}> = () => {
|
||||
title: '初审项性质', dataIndex: 'deviationStatus', width: 200,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Radio.Group disabled={dis} onChange={(event) => {
|
||||
<Radio.Group disabled={dis || deviatedStatus == 0} onChange={(event) => {
|
||||
const value = event.target.value;
|
||||
if (value != undefined) {
|
||||
const data = [...data2];
|
||||
@ -413,12 +493,10 @@ const First: React.FC<{}> = () => {
|
||||
<>
|
||||
{
|
||||
record.id != undefined ? <>
|
||||
<a type="primary" onClick={() => {
|
||||
<a type="primary" onClick={async () => {
|
||||
setSpin(true);
|
||||
treeData.length == 0 ? getTreeData() : null;
|
||||
setChoosedId(record.id);
|
||||
getGlFile(record.id);
|
||||
setGlfile(true);
|
||||
await getGlFile(record.id);
|
||||
}}>关联投标资料</a>
|
||||
<Divider type="vertical" /></>
|
||||
: null
|
||||
@ -477,7 +555,7 @@ const First: React.FC<{}> = () => {
|
||||
title: '初审项性质', dataIndex: 'deviationStatus', width: 200,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Radio.Group disabled={dis} onChange={(event) => {
|
||||
<Radio.Group disabled={dis || deviatedStatus == 0} onChange={(event) => {
|
||||
const value = event.target.value;
|
||||
if (value != undefined) {
|
||||
const data = [...data3];
|
||||
@ -501,12 +579,10 @@ const First: React.FC<{}> = () => {
|
||||
<>
|
||||
{
|
||||
record.id != undefined ? <>
|
||||
<a type="primary" onClick={() => {
|
||||
<a type="primary" onClick={async () => {
|
||||
setSpin(true);
|
||||
treeData.length == 0 ? getTreeData() : null;
|
||||
setChoosedId(record.id);
|
||||
getGlFile(record.id);
|
||||
setGlfile(true);
|
||||
await getGlFile(record.id);
|
||||
}}>关联投标资料</a>
|
||||
<Divider type="vertical" /></>
|
||||
: null
|
||||
@ -564,7 +640,7 @@ const First: React.FC<{}> = () => {
|
||||
title: '初审项性质', dataIndex: 'deviationStatus', width: 200,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Radio.Group disabled={dis} onChange={(event) => {
|
||||
<Radio.Group disabled={dis || deviatedStatus == 0} onChange={(event) => {
|
||||
const value = event.target.value;
|
||||
if (value != undefined) {
|
||||
const data = [...data4];
|
||||
@ -588,12 +664,10 @@ const First: React.FC<{}> = () => {
|
||||
<>
|
||||
{
|
||||
record.id != undefined ? <>
|
||||
<a type="primary" onClick={() => {
|
||||
<a type="primary" onClick={async () => {
|
||||
setSpin(true);
|
||||
treeData.length == 0 ? getTreeData() : null;
|
||||
setChoosedId(record.id);
|
||||
getGlFile(record.id);
|
||||
setGlfile(true);
|
||||
await getGlFile(record.id);
|
||||
}}>关联投标资料</a>
|
||||
<Divider type="vertical" /></>
|
||||
: null
|
||||
@ -656,8 +730,6 @@ const First: React.FC<{}> = () => {
|
||||
{
|
||||
title: '类别', width: 130,
|
||||
render: (value, row, index) => {
|
||||
console.log(dataAll);
|
||||
|
||||
let a = 0;
|
||||
if (l1 > 0) {
|
||||
if (index == 0) {
|
||||
@ -708,7 +780,7 @@ const First: React.FC<{}> = () => {
|
||||
},
|
||||
{ title: '评分项', dataIndex: "scoreItem" },
|
||||
{
|
||||
title: '投标人XXX', dataIndex: "cate", width:400,
|
||||
title: '投标人XXX', dataIndex: "cate", width: 400,
|
||||
render: (_, record) => {
|
||||
return (
|
||||
<Radio.Group >
|
||||
@ -735,9 +807,9 @@ const First: React.FC<{}> = () => {
|
||||
];
|
||||
//方法
|
||||
const typeControlNew = (values: any, updateData: any) => {
|
||||
const { name, type } = values;
|
||||
console.log(values);
|
||||
console.log(updateData);
|
||||
const { type } = values;
|
||||
// console.log(values);
|
||||
// console.log(updateData);
|
||||
let data = [];
|
||||
let ctId = "";
|
||||
const empty = [{ key: 0, scoreItem: "", rvwStandard: "", deviationStatus: 0 }];
|
||||
@ -749,22 +821,22 @@ const First: React.FC<{}> = () => {
|
||||
default: break;
|
||||
}
|
||||
switch (type) {
|
||||
case "形式评审": setType1(true); name != "" && name != undefined ? setName1(name) : null; setCateId1(ctId); updateData != 0 ? setData1(data) : setData1(empty); break;
|
||||
case "资格审查项": setType2(true); name != "" && name != undefined ? setName2(name) : null; setCateId2(ctId); updateData != 0 ? setData2(data) : setData2(empty); break;
|
||||
case "响应性评审": setType3(true); name != "" && name != undefined ? setName3(name) : null; setCateId3(ctId); updateData != 0 ? setData3(data) : setData3(empty); break;
|
||||
case "符合性审查": setType4(true); name != "" && name != undefined ? setName4(name) : null; setCateId4(ctId); updateData != 0 ? setData4(data) : setData4(empty); break;
|
||||
case "形式评审": setType1(true); setCateId1(ctId); updateData != 0 ? setData1(data) : setData1(empty); break;
|
||||
case "资格审查项": setType2(true); setCateId2(ctId); updateData != 0 ? setData2(data) : setData2(empty); break;
|
||||
case "响应性评审": setType3(true); setCateId3(ctId); updateData != 0 ? setData3(data) : setData3(empty); break;
|
||||
case "符合性审查": setType4(true); setCateId4(ctId); updateData != 0 ? setData4(data) : setData4(empty); break;
|
||||
default: break;
|
||||
}
|
||||
//只改名称
|
||||
if (type == "" || type == undefined) {
|
||||
switch (updateData.typeUpdate) {
|
||||
case 1: setName1(name); break;
|
||||
case 2: setName2(name); break;
|
||||
case 3: setName3(name); break;
|
||||
case 4: setName4(name); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
// if (type == "" || type == undefined) {
|
||||
// switch (updateData.typeUpdate) {
|
||||
// case 1: setName1(name); break;
|
||||
// case 2: setName2(name); break;
|
||||
// case 3: setName3(name); break;
|
||||
// case 4: setName4(name); break;
|
||||
// default: break;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
const addItem = (num: number) => {
|
||||
switch (num) {
|
||||
@ -783,13 +855,9 @@ const First: React.FC<{}> = () => {
|
||||
}
|
||||
case 2: {
|
||||
if (data2 == undefined || data2.length == 0) {
|
||||
console.log(1);
|
||||
console.log(data2);
|
||||
const data = [{ key: 0, scoreItem: "", rvwStandard: "", deviationStatus: 0 }];
|
||||
setData2(data);
|
||||
} else {
|
||||
console.log(2);
|
||||
console.log(data2);
|
||||
const count = data2[data2.length - 1].key + 1;
|
||||
const data = [...data2];
|
||||
const newData = { key: count, scoreItem: "", rvwStandard: "", deviationStatus: 0 }
|
||||
@ -836,6 +904,7 @@ const First: React.FC<{}> = () => {
|
||||
case 3: setType3(false); break;
|
||||
case 4: setType4(false); break;
|
||||
}
|
||||
message.success('删除成功');
|
||||
}
|
||||
|
||||
const renderTypeCard1 = () => {
|
||||
@ -845,9 +914,9 @@ const First: React.FC<{}> = () => {
|
||||
<PageHeader
|
||||
className='pageHeaderStyle'
|
||||
ghost={true}
|
||||
title={name1}
|
||||
title={"形式评审"}
|
||||
extra={!dis ? [
|
||||
<a key="1" type="primary" onClick={() => { addItem(1) }}><PlusOutlined />新增审查项 </a>,
|
||||
<a key="1" type="primary" onClick={() => { addItem(1) }}><PlusOutlined />新增审查项(保存生效) </a>,
|
||||
<a key="2" onClick={() => { setUpdateCategory(true); setUpdateData({ typeUpdate: 1, type: '形式评审', name: name1 }) }}><EditOutlined />修改类别 </a>,
|
||||
<a key="3" onClick={async () => {
|
||||
setSpin(true);
|
||||
@ -883,9 +952,9 @@ const First: React.FC<{}> = () => {
|
||||
<PageHeader
|
||||
className='pageHeaderStyle'
|
||||
ghost={true}
|
||||
title={name2}
|
||||
title={'资格审查项'}
|
||||
extra={!dis ? [
|
||||
<a key="1" type="primary" onClick={() => addItem(2)}><PlusOutlined />新增审查项 </a>,
|
||||
<a key="1" type="primary" onClick={() => addItem(2)}><PlusOutlined />新增审查项(保存生效) </a>,
|
||||
<a key="2" onClick={() => { setUpdateCategory(true); setUpdateData({ typeUpdate: 2, type: '资格审查项', name: name2, }) }}><EditOutlined />修改类别 </a>,
|
||||
<a key="3" onClick={async () => {
|
||||
setSpin(true);
|
||||
@ -921,9 +990,9 @@ const First: React.FC<{}> = () => {
|
||||
<PageHeader
|
||||
className='pageHeaderStyle'
|
||||
ghost={true}
|
||||
title={name3}
|
||||
title={'响应性评审'}
|
||||
extra={!dis ? [
|
||||
<a key="1" type="primary" onClick={() => addItem(3)}><PlusOutlined />新增审查项 </a>,
|
||||
<a key="1" type="primary" onClick={() => addItem(3)}><PlusOutlined />新增审查项(保存生效) </a>,
|
||||
<a key="2" onClick={() => { setUpdateCategory(true); setUpdateData({ typeUpdate: 3, type: '响应性评审', name: name3, }) }}><EditOutlined />修改类别 </a>,
|
||||
<a key="3" onClick={async () => {
|
||||
setSpin(true);
|
||||
@ -959,9 +1028,9 @@ const First: React.FC<{}> = () => {
|
||||
<PageHeader
|
||||
className='pageHeaderStyle'
|
||||
ghost={true}
|
||||
title={name4}
|
||||
title={'符合性审查'}
|
||||
extra={!dis ? [
|
||||
<a key="1" type="primary" onClick={() => addItem(4)}><PlusOutlined />新增审查项 </a>,
|
||||
<a key="1" type="primary" onClick={() => addItem(4)}><PlusOutlined />新增审查项(保存生效) </a>,
|
||||
<a key="2" onClick={() => { setUpdateCategory(true); setUpdateData({ typeUpdate: 4, type: '符合性审查', name: name4, }) }}><EditOutlined />修改类别 </a>,
|
||||
<a key="3" onClick={async () => {
|
||||
setSpin(true);
|
||||
@ -1027,16 +1096,9 @@ const First: React.FC<{}> = () => {
|
||||
</Upload>
|
||||
</Menu>
|
||||
);
|
||||
//树
|
||||
const onCheck = (checkedKeys: any) => {
|
||||
// console.log('onCheck', checkedKeys);
|
||||
setCheckedKeys(checkedKeys);
|
||||
};
|
||||
|
||||
const onSelect = (selectedKeys: any, info: any) => {
|
||||
// console.log('onSelect', info);
|
||||
setSelectedKeys(selectedKeys);
|
||||
};
|
||||
|
||||
|
||||
const checkUn = (val: any) => {
|
||||
if (val == undefined || val == null || val == "" || val == [] || val == {} || val == "null") {
|
||||
return false;
|
||||
@ -1069,6 +1131,58 @@ const First: React.FC<{}> = () => {
|
||||
}) : null;
|
||||
setDataAll(data);
|
||||
}
|
||||
function checkEmpty(data: any, type: any) {//校验类别里的空数据
|
||||
let pass = false;
|
||||
if (data != undefined && data.length > 0) {
|
||||
let index = 1;
|
||||
for (const item of data) {
|
||||
if (item.scoreItem == '') {
|
||||
pass = false;
|
||||
message.error(`${type},第${index}行,审查因素不能为空!`)
|
||||
break;
|
||||
}
|
||||
if (item.rvwStandard == '') {
|
||||
pass = false;
|
||||
message.error(`${type}类,第${index}行,审查标准不能为空!`)
|
||||
break;
|
||||
}
|
||||
pass = true;
|
||||
index++;
|
||||
}
|
||||
} else {
|
||||
message.error(`${type}不能为空!`)
|
||||
}
|
||||
return pass;
|
||||
}
|
||||
function changeAllDeviated() {//更改所有初审项性质为不可偏离
|
||||
changeOneDeviated(data1, 1);
|
||||
changeOneDeviated(data2, 2);
|
||||
changeOneDeviated(data3, 3);
|
||||
changeOneDeviated(data4, 4);
|
||||
}
|
||||
function changeOneDeviated(data: any, type: any) {//更改一类初审项性质为不可偏离
|
||||
if (data != undefined && data.length > 0) {
|
||||
let dataT = [...data];
|
||||
data.map((item: any) => {
|
||||
item.deviationStatus = 0;
|
||||
});
|
||||
type == 1 ? setData1(dataT) : null;
|
||||
type == 2 ? setData2(dataT) : null;
|
||||
type == 3 ? setData3(dataT) : null;
|
||||
type == 4 ? setData4(dataT) : null;
|
||||
}
|
||||
}
|
||||
//去重
|
||||
function unique1(arr: any) {
|
||||
var hash = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (hash.indexOf(arr[i]) == -1) {
|
||||
hash.push(arr[i]);
|
||||
}
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
return (
|
||||
<div><Spin spinning={spin}>
|
||||
<Affix offsetTop={top} >
|
||||
@ -1081,34 +1195,54 @@ const First: React.FC<{}> = () => {
|
||||
const id = firstId;
|
||||
const rvwType = "1";
|
||||
let categoryList: any[] = [];
|
||||
if (type1) {
|
||||
categoryList.push({
|
||||
category: '0', id: cateId1, name: name1, detailList: data1,
|
||||
})
|
||||
let pass = true;
|
||||
if (type1 && pass) {
|
||||
pass = checkEmpty(data1, '形式评审');
|
||||
if (pass) {
|
||||
categoryList.push({
|
||||
category: '0', id: cateId1, name: '形式评审', detailList: data1,
|
||||
})
|
||||
}
|
||||
}
|
||||
if (type2) {
|
||||
categoryList.push({
|
||||
category: '1', id: cateId2, name: name2, detailList: data2,
|
||||
})
|
||||
if (type2 && pass) {
|
||||
pass = checkEmpty(data2, '资格审查项');
|
||||
if (pass) {
|
||||
categoryList.push({
|
||||
category: '1', id: cateId2, name: '资格审查项', detailList: data2,
|
||||
})
|
||||
}
|
||||
}
|
||||
if (type3) {
|
||||
categoryList.push({
|
||||
category: '2', id: cateId3, name: name3, detailList: data3,
|
||||
});
|
||||
if (type3 && pass) {
|
||||
pass = checkEmpty(data3, '响应性评审');
|
||||
if (pass) {
|
||||
categoryList.push({
|
||||
category: '2', id: cateId3, name: '响应性评审', detailList: data3,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (type4) {
|
||||
categoryList.push({
|
||||
category: '7', id: cateId4, name: name4, detailList: data4,
|
||||
})
|
||||
if (type4 && pass) {
|
||||
pass = checkEmpty(data4, '符合性审查');
|
||||
if (pass) {
|
||||
categoryList.push({
|
||||
category: '7', id: cateId4, name: '符合性审查', detailList: data4,
|
||||
})
|
||||
}
|
||||
};
|
||||
let allData = { commonId, id, deviatedStatus, deviationNumber, principleStatus, rvwType, categoryList, nodeId }
|
||||
const success = await save(allData);
|
||||
if (success) {
|
||||
queryFirstData();
|
||||
if (pass) {
|
||||
const success = await saveData(allData);
|
||||
if (success) {
|
||||
message.success('保存成功');
|
||||
queryFirstData();
|
||||
// checkRelationRef.current?.reload();
|
||||
}
|
||||
} else {
|
||||
// message.error('不允许存在空项');
|
||||
setSpin(false);
|
||||
}
|
||||
}}>保存</Button>,
|
||||
<Button disabled={dis} key="1" type="primary" onClick={() => setCategory(true)}>新增类别</Button>,
|
||||
<Button key="3" onClick={() => setCheckRelation(true)}>查看关联应答文件</Button>,
|
||||
<Button key="3" onClick={() => { checkRelationRef.current?.reload(); setCheckRelation(true) }}>查看关联应答文件</Button>,
|
||||
<Button key="4" onClick={() => {
|
||||
makeData();
|
||||
setPreview(true);
|
||||
@ -1127,7 +1261,12 @@ const First: React.FC<{}> = () => {
|
||||
</Radio.Group>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="是否可偏离" >
|
||||
<Radio.Group disabled={dis} onChange={(e) => setDeviatedStatus(e.target.value)} value={deviatedStatus}>
|
||||
<Radio.Group disabled={dis} onChange={(e) => {
|
||||
setDeviatedStatus(e.target.value);
|
||||
if (e.target.value == 0) {
|
||||
changeAllDeviated();
|
||||
}
|
||||
}} value={deviatedStatus}>
|
||||
<Radio value={1}>可偏离</Radio>
|
||||
<Radio value={0}>不可偏离</Radio>
|
||||
</Radio.Group>
|
||||
@ -1173,11 +1312,12 @@ const First: React.FC<{}> = () => {
|
||||
</Collapse>
|
||||
<Modal
|
||||
visible={category}
|
||||
width={"30%"}
|
||||
onCancel={() => setCategory(false)}
|
||||
width={500}
|
||||
onCancel={() => { setCategory(false); form.setFieldsValue({ name: '', type: '请选择' }); }}
|
||||
onOk={() => {
|
||||
typeControlNew(form.getFieldsValue(), 0);
|
||||
setCategory(false);
|
||||
form.setFieldsValue({ name: '', type: '请选择' });
|
||||
}}
|
||||
centered
|
||||
title="新增类别"
|
||||
@ -1186,21 +1326,21 @@ const First: React.FC<{}> = () => {
|
||||
{...formLayout}
|
||||
form={form}
|
||||
>
|
||||
<Row>
|
||||
{/* <Row>
|
||||
<Col span={24}><FormItem
|
||||
name="name"
|
||||
label="类别名称"
|
||||
>
|
||||
<Input />
|
||||
<Input style={{ width: "80%" }}/>
|
||||
</FormItem></Col>
|
||||
</Row>
|
||||
</Row> */}
|
||||
<Row>
|
||||
<Col span={24}><FormItem
|
||||
name="type"
|
||||
label="类型"
|
||||
initialValue="请选择"
|
||||
>
|
||||
<Select >
|
||||
<Select style={{ width: "80%" }}>
|
||||
{!type1 ? <Option value="形式评审" key="1">形式评审</Option> : null}
|
||||
{!type2 ? <Option value="资格审查项" key="2">资格审查项</Option> : null}
|
||||
{!type3 ? <Option value="响应性评审" key="3">响应性评审</Option> : null}
|
||||
@ -1228,19 +1368,41 @@ const First: React.FC<{}> = () => {
|
||||
/>
|
||||
) : null}
|
||||
<Modal
|
||||
visible={checkRelation} width={"80%"} centered title="查看关联应答文件" onCancel={() => setCheckRelation(false)}
|
||||
visible={checkRelation} width={1000} centered title="查看关联应答文件" onCancel={() => setCheckRelation(false)}
|
||||
onOk={() => {
|
||||
setCheckRelation(false);
|
||||
}}
|
||||
>
|
||||
<ProTable
|
||||
actionRef={checkRelationRef}
|
||||
columns={columnsCheckRelation}//表格
|
||||
options={false}
|
||||
search={false}
|
||||
tableAlertRender={false}
|
||||
request={(params) => getAllFile({ pageNo: params.current, pageSize: params.pageSize, configId: firstId }).then((res) => {
|
||||
let dataT:any = [...res.data.records];
|
||||
let documentIds: any = [];
|
||||
let documentNames: any = [];
|
||||
console.log(dataT);
|
||||
dataT.map((item: any) => {
|
||||
if (item.documentIds != null) {
|
||||
documentIds = [...item.documentIds.split(',')];
|
||||
documentNames = [...item.documentNames.split(',')];
|
||||
for (var i = 0; i < roots.length; i++) {
|
||||
for (var j = 0; j < documentIds.length; j++) {
|
||||
if (documentIds[j] == roots[i]) {
|
||||
documentIds.splice(j, 1);
|
||||
documentNames.splice(j, 1);
|
||||
j = j - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
item.documentIds = documentIds.join(',');
|
||||
item.documentNames = documentNames.join(',');
|
||||
}
|
||||
});
|
||||
const result = {
|
||||
data: res.data.records,
|
||||
data: dataT,
|
||||
total: res.data.total,
|
||||
success: res.success,
|
||||
pageSize: res.pageSize,
|
||||
@ -1295,7 +1457,7 @@ const First: React.FC<{}> = () => {
|
||||
</Form>
|
||||
</Modal>
|
||||
<Modal
|
||||
visible={temUse} centered title="使用模板" width={"80%"} onCancel={() => setTemUse(false)}
|
||||
visible={temUse} centered title="使用模板" width={1000} onCancel={() => setTemUse(false)}
|
||||
onOk={() => {
|
||||
setTemUse(false);
|
||||
}}
|
||||
@ -1308,7 +1470,6 @@ const First: React.FC<{}> = () => {
|
||||
toolBarRender={() => tools}
|
||||
request={() =>
|
||||
getTemPage({ ...pageTemData }).then((res) => {
|
||||
console.log(res);
|
||||
const result = {
|
||||
data: res.data.records,
|
||||
total: res.data.total,
|
||||
@ -1331,32 +1492,36 @@ const First: React.FC<{}> = () => {
|
||||
/>
|
||||
</Modal>
|
||||
<Modal
|
||||
visible={glfile} title="关联应答文件" width={"20%"} centered onCancel={() => setGlfile(false)}
|
||||
visible={glfile} title="关联应答文件" width={400} centered bodyStyle={{ height: '500px', overflow: 'auto' }} onCancel={() => setGlfile(false)}
|
||||
onOk={async () => {
|
||||
console.log(checkedKeys);
|
||||
setSpin(true);
|
||||
const success = await saveF({ detailId: choosedId, documentIdList: checkedKeys });
|
||||
let checkedKeysT = unique1([...checkedKeys, ...pIds]);
|
||||
const success = await saveF({ detailId: choosedId, documentIdList: checkedKeysT });
|
||||
if (success) {
|
||||
queryFirstData();
|
||||
}
|
||||
setGlfile(false);
|
||||
setCheckedKeys([]);
|
||||
}}
|
||||
><Spin spinning={spin}>
|
||||
<Tree
|
||||
checkable
|
||||
autoExpandParent={true}
|
||||
onCheck={onCheck}
|
||||
checkedKeys={checkedKeys}
|
||||
onSelect={onSelect}
|
||||
treeData={treeData}
|
||||
selectedKeys={selectedKeys}
|
||||
height={300}
|
||||
defaultExpandAll={true}
|
||||
/></Spin>
|
||||
>
|
||||
<Spin spinning={spin}>
|
||||
{
|
||||
treeData.length != 0 ?
|
||||
<Tree
|
||||
checkable
|
||||
autoExpandParent={true}
|
||||
onCheck={onCheck}
|
||||
checkedKeys={checkedKeys}
|
||||
treeData={treeData}
|
||||
height={300}
|
||||
defaultExpandAll={true}
|
||||
/>
|
||||
: '没有应答格式'
|
||||
}
|
||||
</Spin>
|
||||
</Modal>
|
||||
<Modal
|
||||
visible={preview} title="预览" width={"80%"} centered bodyStyle={{ maxHeight: "500px", overflow: 'auto' }}
|
||||
visible={preview} title="预览" width={1000} centered bodyStyle={{ maxHeight: "500px", overflow: 'auto' }}
|
||||
onCancel={() => setPreview(false)}
|
||||
onOk={() => {
|
||||
setPreview(false);
|
||||
@ -1410,14 +1575,14 @@ const UpdateForm: React.FC<updateInterFace> = (props) => {
|
||||
type: values.type,
|
||||
}}
|
||||
>
|
||||
<Row>
|
||||
{/* <Row>
|
||||
<Col span={24}><FormItem
|
||||
name="name"
|
||||
label="类别名称"
|
||||
>
|
||||
<Input style={{ width: "80%" }} />
|
||||
</FormItem></Col>
|
||||
</Row>
|
||||
</Row> */}
|
||||
<Row>
|
||||
<Col span={24}><FormItem
|
||||
name="type"
|
||||
|
@ -1,29 +1,56 @@
|
||||
import React from 'react';
|
||||
import { Tabs,Card } from 'antd';
|
||||
import { PageHeaderWrapper } from '@ant-design/pro-layout';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Tabs } from 'antd';
|
||||
import First from './components/first';
|
||||
import Detailed from './components/detailed';
|
||||
import { getURLInformation } from '@/utils/CommonUtils'
|
||||
import { getBizInfo } from './service'
|
||||
|
||||
|
||||
const Config: React.FC<{}> = () => {
|
||||
const { TabPane } = Tabs;
|
||||
//控制展示页
|
||||
const callback = (key: any) => {
|
||||
|
||||
|
||||
}
|
||||
return(
|
||||
<PageHeaderWrapper>
|
||||
<Card>
|
||||
<Tabs defaultActiveKey="1" onChange={callback} size={"large"} >
|
||||
<TabPane tab="初审设置" key="1">
|
||||
<First/>
|
||||
</TabPane>
|
||||
const [method, methodSet] = useState<any>(false)//评分办法 true 综合评估法(有详审) false 最低价(无)
|
||||
const [proType, proTypeSet] = useState<any>(false)//采购方式
|
||||
useEffect(() => {
|
||||
let bizId = ''
|
||||
let commonId: any = "";
|
||||
if (getURLInformation("id") != null) {
|
||||
commonId = getURLInformation("id")
|
||||
}
|
||||
let nodeId: any = '';
|
||||
if (getURLInformation("nodeId") != null) {
|
||||
nodeId = getURLInformation("nodeId");
|
||||
bizId = nodeId;
|
||||
}
|
||||
//查评分办法和采购方式
|
||||
getBizInfo(bizId).then((res) => {
|
||||
console.log(res);
|
||||
let methodT = false;
|
||||
if (res.code == 200) {
|
||||
const data = res.data;
|
||||
data.evalMethodDict === 'eval_method_2' ? methodT = true : null
|
||||
}
|
||||
methodSet(methodT);
|
||||
});
|
||||
|
||||
}, [])
|
||||
return (
|
||||
<div style={{ backgroundColor: 'white', padding: '10px' }}>
|
||||
<Tabs defaultActiveKey="1" onChange={callback} size={"large"} >
|
||||
<TabPane tab="初审设置" key="1">
|
||||
<First />
|
||||
</TabPane>
|
||||
{method ?
|
||||
<TabPane tab="详审设置" key="2">
|
||||
<Detailed/>
|
||||
<Detailed />
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</Card>
|
||||
</PageHeaderWrapper>
|
||||
: null
|
||||
}
|
||||
</Tabs>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Config;
|
6
src/pages/Bid/ReviewConfig/Config/service.ts
Normal file
6
src/pages/Bid/ReviewConfig/Config/service.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//查询标包信息
|
||||
export async function getBizInfo(id?: any) {
|
||||
return request(`/api/biz-service-ebtp-project/v1/projectSection/${id}`);
|
||||
};
|
Reference in New Issue
Block a user