From a3f9f274b1cf73c4629c0eb9b1a049b9440dc431 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Mon, 21 Mar 2022 13:37:28 +0800 Subject: [PATCH] =?UTF-8?q?3.21=20master=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/router.config.ts | 7 +- src/pages/Project/EntrustWithdraw/index.tsx | 441 ++++++++++++++++++ src/pages/Project/EntrustWithdraw/service.ts | 22 + src/pages/Project/EntrustWithdraw/styles.less | 8 + 4 files changed, 477 insertions(+), 1 deletion(-) create mode 100644 src/pages/Project/EntrustWithdraw/index.tsx create mode 100644 src/pages/Project/EntrustWithdraw/service.ts create mode 100644 src/pages/Project/EntrustWithdraw/styles.less diff --git a/config/router.config.ts b/config/router.config.ts index 89b99d4..a63478c 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -155,6 +155,11 @@ export default [ }, ] }, + {//委托撤回 + name: 'entrustWithdraw', + path: '/Project/EntrustWithdraw', + component: './Project/EntrustWithdraw', + }, {//招标项目管理 name: 'bidManage', path: '/Bid', @@ -318,5 +323,5 @@ export default [ { component: './404', }, - + ]; diff --git a/src/pages/Project/EntrustWithdraw/index.tsx b/src/pages/Project/EntrustWithdraw/index.tsx new file mode 100644 index 0000000..aadef01 --- /dev/null +++ b/src/pages/Project/EntrustWithdraw/index.tsx @@ -0,0 +1,441 @@ +import React, { useState, useRef, useEffect } from 'react'; +import { Modal, Col, Input, Form, Row, PageHeader, Button, Spin, Upload } from 'antd'; +import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table'; +import { proTableValueEnum, returnDictVal } from '@/utils/CommonUtils'; +import { getPage, queryEntrust } from './service'; +import './styles.less'; +import { getDicData, getSessionUserData } from '@/utils/session'; + +const entrust: React.FC<{}> = () => { + const modalHeight = window.innerHeight * 96 / 100; + const formLayout = { + labelCol: { span: 8 }, + wrapperCol: { span: 16 }, + }; + //获取字典 + const getDict: any = getDicData(); + const dictData = JSON.parse(getDict); + const { TextArea } = Input; + const FormItem = Form.Item; + const [form] = Form.useForm(); + //人员信息 + const userData = getSessionUserData(); + //protable actionRef + const actionRef = useRef(); + //显隐 查看及分派弹窗 + const [checkModal, checkModalSet] = useState(false); + //loading + const [spin, spinSet] = useState(false); + const [recordId, recordIdSet] = useState('');//单行id + const [sectionsInfo, sectionsInfoSet] = useState([]);//标段信息 + const [oneAllInfo, oneAllInfoSet] = useState([{}]);//一行查出来的所有数据 + const [files, filesSet] = useState([]);//附件 + + //查询分页数据 + const [pageData, pageDataSet] = useState({ + pageNo: 1, + pageSize: 10 + }); + + //委托列表 + const columns: ProColumns[] = [ + { title: '序号', valueType: 'index', width: 60, }, + { title: '委托方', dataIndex: 'purchaser', width: '10%', search: false }, + { title: '项目名称', dataIndex: 'projectName', }, + { title: '方案编号', dataIndex: 'projectNumber', width: '10%', search: false }, + { title: '接收时间', dataIndex: 'receiveTime', width: '10%', valueType: 'dateTime', search: false }, + { title: '撤回时间', dataIndex: 'createDate', width: '10%', valueType: 'dateTime', search: false }, + { title: '采购方式', dataIndex: 'procurementMode', width: '10%', valueEnum: proTableValueEnum(dictData['procurement_mode=entrust']) }, + { title: '标的类型', dataIndex: 'procurementType', width: '10%', search: false, valueEnum: proTableValueEnum(dictData['procurement_type=entrust']) }, + { + title: '操作', width: '12%', + valueType: 'option', + render: (_, record) => { + return + } + }, + ]; + //物资清单 + const columnsWz: ProColumns[] = [ + { title: '需求单名称', dataIndex: 'requName', key: 'requName', }, + { title: '需求单编号', dataIndex: 'requNo', key: 'requNo', }, + { title: '物料说明', dataIndex: 'materialDesc', key: 'materialDesc', }, + { title: '本次采购数量', dataIndex: 'num', key: 'num', }, + { title: '单位', dataIndex: 'unit', key: 'unit', }, + ]; + //询价商品 + const columnsXunJiaGood: ProColumns[] = [ + { title: '物料编码', dataIndex: 'itemNumber', }, + { title: '物料名称', dataIndex: 'itemDescription', }, + { title: '商品分类', dataIndex: 'categoryName', }, + // { title: '属性', dataIndex: '', }, + { title: '品牌名称', dataIndex: 'brandName', }, + { title: '物料描述', dataIndex: 'note', }, + { title: '数量', dataIndex: 'num', }, + { title: '单位', dataIndex: 'unit', }, + { title: '基准价', dataIndex: 'standardPrice', }, + { title: '权重占比', dataIndex: 'weightRatio', }, + ]; + //供应商 + const columnsGys: ProColumns[] = [ + { title: '供应商名称', dataIndex: 'suppName', key: 'suppName', }, + { title: '联系人', dataIndex: 'suppLinkManName', key: 'suppLinkManName', }, + { title: '联系人邮箱', dataIndex: 'suppLinkManEmail', key: 'suppLinkManEmail', }, + ]; + //查询委托信息 + useEffect(() => { + if (recordId != '') { + getEntrustInfo(); + } + }, [recordId]); + async function getEntrustInfo() { + spinSet(true); + form.resetFields(); + await queryEntrust({ id: recordId }).then((res) => { + const data = res.data; + let filesList: any[] = [];//附件 + if (data != undefined) { + let ssxm = data.projectEntrustExpand.purpImplementSendVO;//实施项目信息 + if (data.procurementMode === 'procurement_mode_7') {//询价委托 + const inquiry = data.projectEntrustExpand.inquiry + form.setFieldsValue({ + ...inquiry, + inquiryModel: inquiry.inquiryModel == 0 ? '公开询价' : inquiry.inquiryModel == 1 ? '定向询价' : '',//询价模式 + bidType: inquiry.bidType == 1 ? '货物' : inquiry.bidType == 2 ? '服务' : inquiry.bidType == 3 ? '施工服务' : '', + projectManagerName: data.projectManagerName, + projectManagerPhone: data.projectManagerPhone, + projectName: data.projectName,//项目名称 + selectType: inquiry.selectType == 0 ? '综合评分法' : inquiry.selectType == 1 ? '最低价法' : '',//中选原则 + delegationName: inquiry.delegationName,//代理机构名称 + cgfs: '公开询价', + }); + inquiry.attachmentList.map((item: any) => { + let one = {}; + one['uid'] = item.fileId; + one['name'] = item.fileName; + one['url'] = '/api/core-service-ebtp-updownload/v1/attachment/download/oid/' + item.fileId; + filesList.push(one); + }); + } else { + form.setFieldsValue({ + ...data, + organization: returnDictVal(dictData['organization=entrust'], data.organization), + sxmmc: ssxm.purpImplementName, + sxmbh: ssxm.purpImplementNo, + sxmid: ssxm.id, + procurementMode: returnDictVal(dictData['procurement_mode=entrust'], data.procurementMode,), + fxmmc: ssxm.purpSuperVo.purpSuperName, + fxmbh: ssxm.purpSuperVo.purpSuperNo, + fxmid: ssxm.purpSuperVo.id, + businessType: returnDictVal(dictData['bid_method_sub=record'], ssxm.purpSuperVo.businessType,), + }); + if (ssxm.purpBaseInfoVoList != undefined) { + sectionsInfoSet(ssxm); + } + } + + } + oneAllInfoSet(data); + filesSet(filesList); + checkModalSet(true); + }); + spinSet(false); + } + function reset() {//重置数据 + sectionsInfoSet([]); + oneAllInfoSet([]); + recordIdSet(''); + form.resetFields(); + } + //查看及委托 + const checkChild = () => {//查看页面 + return ( + <> +
+

分派信息

+ + + + + + + + + + + + + {//非询价项目 + oneAllInfo.procurementMode !== 'procurement_mode_7' ? + returnProInfo() + : null + } + {//询价项目 + oneAllInfo.procurementMode === 'procurement_mode_7' ? + returnXunJiaProInfo() + : null + } +
+ + ) + } + function returnProInfo() {//返回 非询价项目 委托项目信息 + return ( + <> +

委托项目信息

+ + {returnCol("purchaser", "purchaser", "委托方")} + {returnCol("organization", "organization", "组织方式")} + + + {returnColArea("entrustDepartment", "entrustDepartment", "委托部门ID")} + {returnColArea("entrustDepartmentName", "entrustDepartmentName", "采购实施部门")} + + + {returnColArea("agencyCompanyName", "agencyCompanyName", "代理公司")} + {returnColArea("sxmmc", "sxmmc", "采购实施项目名称")} + + + {returnCol("sxmbh", "sxmbh", "采购实施项目编号")} + {returnCol("sxmid", "sxmid", "采购实施项目ID")} + + + {returnCol("purchasingManagerName", "purchasingManagerName", "采购经理")} + {returnCol("purchasingManagerPhone", "purchasingManagerPhone", "采购经理电话")} + + + {returnCol("procurementMode", "procurementMode", "采购方式")} + {returnColArea("fxmmc", "fxmmc", "父项目名称")} + + + {returnCol("fxmbh", "fxmbh", "父项目编号")} + {returnCol("fxmid", "fxmid", "父项目ID")} + + + {returnCol("businessType", "businessType", "业务类型")} + + + {/* {proType == '招标' && sectionsInfo.purpBaseInfoVoList != undefined ? ( */} + {sectionsInfo.purpBaseInfoVoList != undefined ? ( + sectionsInfo.purpBaseInfoVoList.map((item: any, index: any) => { + return ( + <> +

{`标段信息`}

+ + {returnColInit("xmid", `xmid${index}`, "采购项目ID", item.id)} + {returnColInit("cgmc", `cgmc${index}`, "采购名称", item.purpName, true)} + + + {returnColInit("fabh", `fabh${index}`, "采购编号", item.purpNo)} + {returnColInit("faid", `faid${index}`, "方案ID", item.projBaseInfoVO.id)} + + + {returnColInit("purpContext", `purpContext${index}`, "项目背景", item.purpContext, true)} + {returnColInit("organName", `organName${index}`, "机构名称", item.organName)} + + + {returnColInit("bys", `bys${index}`, "预算金额(元)(不含税)", item.budgetAmount)} + {returnColInit("cglx", `cglx${index}`, "标的类型", returnDictVal(dictData['ebp_target_type=ebp_project'], item.projBaseInfoVO.targetType))} + + + {returnColInit("psbf", `psbf${index}`, "评审方法", item.projBaseInfoVO.reviewMethod)} + {returnColInit("zjly", `zjly${index}`, "资金来源", returnDictVal(dictData['ebp_fund_orign=ebp_project'], item.projBaseInfoVO.fundOrign))} + + + {/* {returnColInit("suborProvince", `suborProvince${index}`, "所属省分", item.suborProvince)} */} + + + { + item.projBaseInfoVO?.baseFileNoPageVOList?.length > 0 ? + <> + {fileback(item.projBaseInfoVO?.baseFileNoPageVOList)} + + : '无附件' + } + + +

物资清单

+ +

供应商(请以实际报名供应商为准)

+ + + ) + }) + ) : null} + + ) + } + function returnXunJiaProInfo() {//返回 询价项目 委托项目信息 + return ( + <> +

委托项目信息

+ + {returnCol("inquiryNo", "inquiryNo", "询价单号")} + {returnCol("managerCn", "managerCn", "询价人姓名")} + + + {returnCol("inquiryOrg", "inquiryOrg", "询价单位名称")} + {returnCol("inquiryModel", "inquiryModel", "询价模式")} + + + {returnCol("projectName", "projectName", "项目名称")} + {returnCol("cgfs", "cgfs", "采购方式")} + + + {returnCol("delegationName", "delegationName", "代理机构名称")} + {returnCol("selectType", "selectType", "中选原则")} + + + {returnCol("bidType", "bidType", "标的类型")} + + + + { + files.length > 0 ? : '无附件' + } + + +

物资清单

+ + + ) + } + + //附件 + function fileback(data: any) { + let fileList: any[] = []; + data.map((item: any) => { + let one = {} + one['uid'] = item.documentCenterFileId; + one['name'] = item.originalName; + one['url'] = '/api/core-service-ebtp-updownload/v1/attachment/download/oid/' + item.documentCenterFileId; + fileList.push(one); + }) + return + } + //返回col + const returnCol = (key: any, name: any, label: any) => { + return ( + + + + ) + } + //返回col area + const returnColArea = (key: any, name: any, label: any) => { + return ( + +