3.10 工程代码同步master
This commit is contained in:
147
src/pages/SystemMessage/message/components/messageDetail.tsx
Normal file
147
src/pages/SystemMessage/message/components/messageDetail.tsx
Normal file
@ -0,0 +1,147 @@
|
||||
import { followUpAProjectManager, followUpAProjectSupplier, getSessionRoleData } from "@/utils/session";
|
||||
import { Button, Form, Input, Modal } from "antd"
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { describeSiteMsgDetail, selectMsgRead, getProjectById } from '../service'
|
||||
import { history } from 'umi';
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
interface filesManageComponents {
|
||||
modalVisible: boolean;
|
||||
messId: string;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 15 },
|
||||
};
|
||||
|
||||
const filesManageComponents: React.FC<filesManageComponents> = (props) => {
|
||||
const { modalVisible, messId, onCancel } = props;
|
||||
const [form] = Form.useForm();
|
||||
const [knowVisible, setKnowVisible] = useState<any>(false); // 知道了禁用
|
||||
const [detailId, setDetailId] = useState<any>(); // 详情id
|
||||
const [projectId, setProjectId] = useState<any>(); // 项目id
|
||||
const [roomType, setRoomType] = useState<any>(); // 判断资审候审
|
||||
const [routeType, setRouteType] = useState<any>(); // 判断澄清提疑
|
||||
const [disFollowUp, setDisFollowUp] = useState<boolean>(false) //跟进按钮隐藏
|
||||
const role = getSessionRoleData().roleCode;
|
||||
|
||||
useEffect(() => {
|
||||
Int();
|
||||
}, [messId]);
|
||||
const Int = () => {
|
||||
describeSiteMsgDetail(messId).then(res => {
|
||||
// if(res.code == 200){
|
||||
res.authorizestate == '0' ? setKnowVisible(false) : setKnowVisible(true)
|
||||
form.setFieldsValue({
|
||||
"title": res.title,
|
||||
"createtime": res.createtime,
|
||||
"content": res.content
|
||||
});
|
||||
setDetailId(res.msgId)
|
||||
if (res?.servicecode) {
|
||||
let detailMess = JSON.parse(res?.servicecode)
|
||||
setProjectId(detailMess.tp_id)
|
||||
setRoomType(detailMess.room_type)
|
||||
setRouteType(detailMess.type)
|
||||
} else {
|
||||
// message.error('项目数据错误,无法获取流程,请联系管理员!')
|
||||
setDisFollowUp(true)
|
||||
}
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
const getRead = () => { // 知道了
|
||||
selectMsgRead(detailId).then(res => {
|
||||
setKnowVisible(true)
|
||||
});
|
||||
}
|
||||
|
||||
const getFollow = async () => { // 跟进
|
||||
if (role == "ebtp-supplier") { // 供应商
|
||||
await getProjectById(projectId).then(async response => {
|
||||
if (response?.code == 200 && response?.success == true) {
|
||||
const resData = response?.data
|
||||
await followUpAProjectSupplier(resData);
|
||||
|
||||
if (routeType == 'clarify') {
|
||||
if (roomType == '1') {
|
||||
history.push('/ProjectLayout/ZYuShen/Tender/supplier/SupplierClarificationList?roomType=1')
|
||||
} else {
|
||||
history.push('/ProjectLayout/Tender/supplier/SupplierClarificationList?roomType=2')
|
||||
}
|
||||
} else {
|
||||
history.push('/ProjectLayout/Tender/supplier/SupplierQuestionsOrObjections')
|
||||
}
|
||||
}
|
||||
})
|
||||
} else if (role == "ebtp-agency-project-manager" || role == 'ebtp-purchase') { // 项目经理、采购经理
|
||||
await getProjectById(projectId).then(async response => {
|
||||
if (response?.code == 200 && response?.success == true) {
|
||||
const resData = response?.data
|
||||
await followUpAProjectManager(resData);
|
||||
|
||||
if (routeType == 'clarify') {
|
||||
if (roomType == '1') {
|
||||
history.push('/ProjectLayout/ZYuShen/Tender/ProjectManager/ClarifyTheList?roomType=1')
|
||||
} else {
|
||||
history.push('/ProjectLayout/Tender/ProjectManager/ClarifyTheList?roomType=2')
|
||||
}
|
||||
} else {
|
||||
history.push('/ProjectLayout/Tender/ProjectManager/MentionDoubtReply')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
destroyOnClose={true}
|
||||
getContainer={false}
|
||||
title='消息详情'
|
||||
visible={modalVisible}
|
||||
onCancel={() => onCancel()}
|
||||
width={800}
|
||||
centered
|
||||
footer={[
|
||||
<Button onClick={onCancel}>关闭</Button>,
|
||||
<Button disabled={knowVisible} type="primary" onClick={() => getRead()}>知道了</Button>,
|
||||
<Button disabled={disFollowUp} onClick={() => getFollow()} type="primary">跟进</Button>
|
||||
]}
|
||||
>
|
||||
<Form
|
||||
{...layout}
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
|
||||
<Form.Item
|
||||
label="标题"
|
||||
name="title"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="创建时间"
|
||||
name="createtime"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="内容"
|
||||
name="content"
|
||||
>
|
||||
<TextArea readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default filesManageComponents
|
162
src/pages/SystemMessage/message/components/pageDetail.tsx
Normal file
162
src/pages/SystemMessage/message/components/pageDetail.tsx
Normal file
@ -0,0 +1,162 @@
|
||||
import { Button, Form, Input, message, Modal } from "antd"
|
||||
import { Color } from "chalk";
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { describeSiteMsgDetail, getProjectById, selectMsgRead } from '../service'
|
||||
import '@/assets/ld_style.less'
|
||||
import { history } from 'umi';
|
||||
import { followUpAProjectSupplier } from '@/utils/session';
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
interface filesManageComponents {
|
||||
modalVisible: boolean;
|
||||
clarifyId: string;
|
||||
dateNum: Number;
|
||||
trelist: [];
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 15 },
|
||||
};
|
||||
|
||||
const filesManageComponents: React.FC<filesManageComponents> = (props) => {
|
||||
const { modalVisible, clarifyId, onCancel, trelist, dateNum } = props;
|
||||
const [form] = Form.useForm();
|
||||
const [detailId, setDetailId] = useState<any>(clarifyId); // 详情id
|
||||
const [lastVisible, setLastVisible] = useState<boolean>(trelist?.indexOf(clarifyId) == 0 ? true : false); // 上一条禁用
|
||||
const [nextVisible, setNextVisible] = useState<boolean>(trelist?.indexOf(clarifyId) == trelist?.length - 1 ? true : false); // 下一条禁用
|
||||
const [knowVisible, setKnowVisible] = useState<any>(false); // 知道了禁用
|
||||
const [projectId, setProjectId] = useState<any>(); // 项目id
|
||||
const [roomType, setRoomType] = useState<any>(); // 判断资审候审
|
||||
const [disFollowUp, setDisFollowUp] = useState<boolean>(false) //跟进按钮隐藏
|
||||
|
||||
useEffect(() => {
|
||||
Int(clarifyId);
|
||||
setDetailId(clarifyId)
|
||||
}, [clarifyId]);
|
||||
const Int = (detailId: any) => {
|
||||
describeSiteMsgDetail(detailId).then(res => {
|
||||
// if(res.code == 200){
|
||||
if (res?.servicecode) {
|
||||
let detailMess = JSON.parse(res.servicecode)
|
||||
setProjectId(detailMess.tp_id)
|
||||
setRoomType(detailMess.room_type)
|
||||
} else {
|
||||
// message.error('项目数据错误,无法获取流程,请联系管理员!')
|
||||
setDisFollowUp(true)
|
||||
}
|
||||
res.authorizestate == '0' ? setKnowVisible(false) : setKnowVisible(true)
|
||||
form.setFieldsValue({
|
||||
"title": res.title,
|
||||
"createtime": res.createtime,
|
||||
"content": res.content
|
||||
});
|
||||
// }
|
||||
});
|
||||
};
|
||||
|
||||
const next = () => { // 下一条
|
||||
setLastVisible(false)
|
||||
let current = trelist.indexOf(detailId)
|
||||
if (current < trelist.length - 2 && current != trelist.length - 2) {
|
||||
setDetailId(trelist[current + 1])
|
||||
Int(trelist[current + 1])
|
||||
} else if (current == trelist.length - 2) {
|
||||
setDetailId(trelist[current + 1])
|
||||
Int(trelist[current + 1])
|
||||
setNextVisible(true)
|
||||
} else {
|
||||
setNextVisible(true)
|
||||
}
|
||||
}
|
||||
|
||||
const last = () => { // 上一条
|
||||
setNextVisible(false)
|
||||
let current: any = trelist.indexOf(detailId)
|
||||
if (current > 0 && current != 1) {
|
||||
setDetailId(trelist[current - 1])
|
||||
Int(trelist[current - 1])
|
||||
} else if (current == 1) {
|
||||
setDetailId(trelist[current - 1])
|
||||
Int(trelist[current - 1])
|
||||
setLastVisible(true)
|
||||
} else {
|
||||
setLastVisible(true)
|
||||
}
|
||||
}
|
||||
|
||||
const getRead = () => { // 知道了
|
||||
selectMsgRead(detailId).then(res => {
|
||||
setKnowVisible(true)
|
||||
});
|
||||
}
|
||||
|
||||
const getFollow = async () => { // 跟进
|
||||
await getProjectById(projectId).then(async response => {
|
||||
if (response?.code == 200 && response?.success == true) {
|
||||
const resData = response?.data
|
||||
await followUpAProjectSupplier(resData);
|
||||
|
||||
if (roomType == '1') {
|
||||
history.push('/ProjectLayout/ZYuShen/Tender/supplier/SupplierClarificationList?roomType=1')
|
||||
} else {
|
||||
history.push('/ProjectLayout/Tender/supplier/SupplierClarificationList?roomType=2')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
destroyOnClose={true}
|
||||
getContainer={false}
|
||||
title='消息详情'
|
||||
visible={modalVisible}
|
||||
onCancel={() => onCancel()}
|
||||
width={800}
|
||||
centered
|
||||
footer={[
|
||||
<Button onClick={onCancel}>关闭</Button>,
|
||||
<Button disabled={knowVisible} type="primary" onClick={() => getRead()}>知道了</Button>,
|
||||
<Button disabled={disFollowUp} onClick={() => getFollow()} type="primary">跟进</Button>]}
|
||||
>
|
||||
<p className="tips">您有 {dateNum} 条未读澄清信息,当前只显示 6 条最近的澄清,请到<span onClick={() => history.push('/SystemMessage/message')}> 这里 </span>查看全部澄清信息</p>
|
||||
<Form
|
||||
{...layout}
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
|
||||
<Form.Item
|
||||
label="标题"
|
||||
name="title"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="创建时间"
|
||||
name="createtime"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="内容"
|
||||
name="content"
|
||||
>
|
||||
<TextArea readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<div className="btnBox">
|
||||
<Button disabled={lastVisible} className="last" onClick={() => last()}>上一条</Button>
|
||||
<Button disabled={nextVisible} onClick={() => next()}>下一条</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default filesManageComponents
|
||||
|
81
src/pages/SystemMessage/message/components/questDetail.tsx
Normal file
81
src/pages/SystemMessage/message/components/questDetail.tsx
Normal file
@ -0,0 +1,81 @@
|
||||
import { Form, Input, Modal } from "antd"
|
||||
import React, { useEffect } from "react"
|
||||
import pageBg from '../../../../images/answer/bg.png'
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
interface QuestDetailProps {
|
||||
modalVisible: boolean;
|
||||
questData: any;
|
||||
onCancel: () => void;
|
||||
}
|
||||
|
||||
const layout = {
|
||||
labelCol: { span: 6 },
|
||||
wrapperCol: { span: 15 },
|
||||
};
|
||||
|
||||
const QuestDetail: React.FC<QuestDetailProps> = (props) => {
|
||||
const { modalVisible, questData, onCancel } = props;
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
Int();
|
||||
}, [questData?.id]);
|
||||
|
||||
const Int = () => {
|
||||
form.setFieldsValue({
|
||||
...questData
|
||||
})
|
||||
};
|
||||
|
||||
const getFollow = async () => { // 跟进
|
||||
window.open(`/QuestAnswer/Answer?code=${questData?.id}`);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
className="model-container"
|
||||
destroyOnClose={true}
|
||||
getContainer={false}
|
||||
title='参与调研'
|
||||
visible={modalVisible}
|
||||
onOk={() => getFollow()}
|
||||
onCancel={() => onCancel()}
|
||||
width={800}
|
||||
centered
|
||||
okText='参与'
|
||||
cancelText='返回'
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
|
||||
<Form.Item
|
||||
name="title"
|
||||
className="model-title"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="截止时间"
|
||||
name="endTime"
|
||||
className="model-time"
|
||||
>
|
||||
<Input readOnly bordered={false} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="desc"
|
||||
>
|
||||
<TextArea className="remarks" readOnly bordered={false} autoSize />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<div><img src={pageBg} /></div>
|
||||
</Modal>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default QuestDetail
|
Reference in New Issue
Block a user