3.10 工程代码同步master
This commit is contained in:
185
src/pages/ExamineAndApprove/InvitationLetter/index.tsx
Normal file
185
src/pages/ExamineAndApprove/InvitationLetter/index.tsx
Normal file
@ -0,0 +1,185 @@
|
||||
/*
|
||||
* @Author: liqing
|
||||
* @Date: 2021-03-12 09:39:21
|
||||
* @LastEditTime: 2021-03-15 16:40:55
|
||||
* @Description: In User Settings Edit
|
||||
* @FilePath: \ebtp-cloud-frontend\src\pages\ExamineAndApprove\ProcurementRequirementsArePublicized.tsx
|
||||
*/
|
||||
import { getURLInformation } from '@/utils/CommonUtils';
|
||||
import ExtendUpload from '@/utils/ExtendUpload';
|
||||
import { Card, Collapse, Descriptions } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import BasicInformation from '../BasicInformation/BasicInformation';
|
||||
import { selectDefaultNameByBidMethodDict, selectNameByBidMethodDict } from '../utils';
|
||||
import { selectAnnoById, selectDocumentsById } from '../Announcement/service';
|
||||
import '@/utils/lq.style.less';
|
||||
import { getSessionRoleData, getUserToken } from '@/utils/session';
|
||||
import moment from "moment";
|
||||
const { Panel } = Collapse;
|
||||
|
||||
/**
|
||||
* 邀请函
|
||||
* @returns
|
||||
*/
|
||||
const ProcurementRequirementsArePublicized: React.FC = () => {
|
||||
//邀请函id
|
||||
const annoId = getURLInformation('id');
|
||||
//审批单id
|
||||
const [processInstanceId, setProcessInstanceId] = useState<string>('');
|
||||
//weboffice
|
||||
const [contentWithStyle, setContentWithStyle] = useState('');
|
||||
|
||||
const [processName, setProcessName] = useState<any>(selectDefaultNameByBidMethodDict());
|
||||
|
||||
//列表展示信息
|
||||
const [listDisplayInfo, setListDisplayInfo] = useState<any>({
|
||||
annoTitle: '',
|
||||
docStartTime: '',
|
||||
docEndTime: '',
|
||||
replyEndTime: '',
|
||||
openingTime: '',
|
||||
sectionNames: '',
|
||||
attDatasetId: '',
|
||||
documentsList: []
|
||||
});
|
||||
useEffect(() => {
|
||||
selectAnnoById(annoId).then((res) => {
|
||||
if (res.code === 200) {
|
||||
let data = res?.data;
|
||||
selectDocumentsById(annoId).then(response => {
|
||||
if(res?.code == 200) {
|
||||
setListDisplayInfo({
|
||||
annoTitle: data?.annoTitle,
|
||||
docStartTime: moment(data?.docStartTime).format('YYYY-MM-DD HH:mm'),
|
||||
docEndTime: moment(data?.docEndTime).format('YYYY-MM-DD HH:mm'),
|
||||
replyEndTime: moment(data?.replyEndTime).format('YYYY-MM-DD HH:mm'),
|
||||
openingTime: moment(data?.openingTime).format('YYYY-MM-DD HH:mm'),
|
||||
sectionNames: data?.sectionNames,
|
||||
attDatasetId: data?.attDatasetId,
|
||||
documentsList: [...response?.data]
|
||||
});
|
||||
}
|
||||
})
|
||||
setContentWithStyle(data?.contentWithStyle);
|
||||
setProcessName(selectNameByBidMethodDict(data?.annoType));
|
||||
setProcessInstanceId(data?.approvalInstanceId);
|
||||
}
|
||||
});
|
||||
window.parent.postMessage("{'height':"+document.documentElement.scrollHeight+"}",'*' );
|
||||
}, []);
|
||||
|
||||
//weboffice变更文件名称下载方法
|
||||
const getFileList = (bid: any,fileName: any) => {
|
||||
window.fetch(`/api/core-service-ebtp-updownload/v1/attachment/download/bid/${bid}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
// JwtToken: getSessionUserData() == null ? null : getSessionUserData().userId,
|
||||
Authorization:getUserToken(),
|
||||
currentRoleCode: getSessionRoleData()?.roleCode,
|
||||
},
|
||||
credentials: 'include',
|
||||
}).then((response) => {
|
||||
// 这里才是下载附件逻辑处理的地方
|
||||
response.blob().then(blob => {
|
||||
const blobUrl = window.URL.createObjectURL(blob);
|
||||
const aElement = document.createElement("a");
|
||||
aElement.href = blobUrl; // 设置a标签路径
|
||||
aElement.download = fileName;
|
||||
aElement.click();
|
||||
window.URL.revokeObjectURL(blobUrl);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<Card bordered={false} bodyStyle={{ padding: '0 200px', borderRadius: 6 }}>
|
||||
<h2 style={{ textAlign: 'center', marginTop: 10 }}>邀请函审批单</h2>
|
||||
<Collapse defaultActiveKey={['1','2','3']} style={{ marginTop: 30 }}>
|
||||
<Panel header="基本信息" key="1">
|
||||
<BasicInformation processInstanceId={processInstanceId} />
|
||||
</Panel>
|
||||
<Panel header="邀请函信息" key="2">
|
||||
<Descriptions bordered column={1}>
|
||||
<Descriptions.Item label="邀请函名称" labelStyle={{ textAlign: 'center',width: '40%' }}>
|
||||
{listDisplayInfo.annoTitle}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={processName.name1 + '文件获取开始时间'}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{listDisplayInfo.docStartTime}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={processName.name1 + '文件获取截止时间'}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{listDisplayInfo.docEndTime}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={processName.name2 + '截止时间'}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{listDisplayInfo.replyEndTime}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={processName.name3 + '时间'}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{listDisplayInfo.openingTime}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={'关联' + processName.name4}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{listDisplayInfo.sectionNames}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="附件文件" labelStyle={{ textAlign: 'center' }}>
|
||||
<ExtendUpload
|
||||
bid={listDisplayInfo.attDatasetId}
|
||||
btnName="附件"
|
||||
uploadProps={{ disabled: true }}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<h3 className="first-title">邀请函发布内容</h3>
|
||||
<p className="table-border" dangerouslySetInnerHTML={{ __html: contentWithStyle }}></p>
|
||||
</Panel>
|
||||
<Panel header="文件信息" key="3">
|
||||
{listDisplayInfo.documentsList.map((item: any,index: any) => {
|
||||
return <Descriptions bordered column={1} key={index} style={{marginBottom: 8}}>
|
||||
<Descriptions.Item
|
||||
label={processName.name1 + '文件名称'}
|
||||
labelStyle={{ textAlign: 'center' ,width: '40%' }}
|
||||
>
|
||||
{item?.documentName}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label={'关联' + processName.name4}
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
{item?.sections?.map((e: any) => e.bsName).join(",")}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label="附件"
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
<ExtendUpload
|
||||
bid={item?.documentSetId}
|
||||
btnName="附件"
|
||||
uploadProps={{ disabled: true }}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
label="正文"
|
||||
labelStyle={{ textAlign: 'center' }}
|
||||
>
|
||||
<a style={{color:"#b30000"}} key="zhengwen" onClick={() => getFileList(item?.contentFileId,`${item?.documentName}(正文).doc`)}>{item?.documentName}(正文).doc</a>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
})}
|
||||
</Panel>
|
||||
</Collapse>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
export default ProcurementRequirementsArePublicized;
|
Reference in New Issue
Block a user