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
|
121
src/pages/SystemMessage/message/index.tsx
Normal file
121
src/pages/SystemMessage/message/index.tsx
Normal file
@ -0,0 +1,121 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import ProTable, { ActionType } from '@ant-design/pro-table';
|
||||
import { describeSiteMsg, getQuestList } from './service';
|
||||
import { Button, Card, Spin } from 'antd';
|
||||
import MessageDetail from "./components/messageDetail"
|
||||
import QuestDetail from './components/questDetail';
|
||||
|
||||
const FilesList: React.FC<{}> = () => {
|
||||
const checkRelationRef = useRef<ActionType>(); //操作数据后刷新列表
|
||||
const [messageDetail, setMessageDetail] = useState<boolean>(false);
|
||||
const [messId, setMessId] = useState<string>('');//公告id
|
||||
const [questVisible, setQuestVisible] = useState<boolean>(false);//问卷visible
|
||||
const [questData, setQuestData] = useState<any>({});//问卷数据
|
||||
const [loading, setLoading] = useState<boolean>(false);//loading
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '序号',
|
||||
valueType: 'index',
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'title',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createtime',
|
||||
valueType: 'dateTime',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'templatetype',
|
||||
valueEnum: {
|
||||
1: { text: '提疑消息' },
|
||||
2: { text: '澄清消息' },
|
||||
3: { text: '调查问卷' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'authorizestate',
|
||||
initialValue: 'noRead',
|
||||
valueEnum: {
|
||||
0: { text: '未读' },
|
||||
1: { text: '已读' },
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
render: (record: any) => {
|
||||
return (
|
||||
record.templatetype == '3' ? (
|
||||
<Button type="text" key="participate" onClick={() => toParticipate(record.servicecode)}>参与调研</Button>
|
||||
) : (
|
||||
<Button type="text" key="detail" onClick={() => lookDetail(record.msgId)}>查看</Button>
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
const lookDetail = (id: any) => {
|
||||
setMessId(id)
|
||||
setMessageDetail(true)
|
||||
}
|
||||
|
||||
const toParticipate = async (servicecode: any) => {
|
||||
const { questId } = JSON.parse(servicecode);
|
||||
setLoading(true);
|
||||
await getQuestList({ id: questId }).then(res => {
|
||||
if (res?.code == 200 && res?.success) {
|
||||
setQuestData(res?.data)
|
||||
setQuestVisible(true)
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Card title="系统消息">
|
||||
<Spin spinning={loading}>
|
||||
<ProTable
|
||||
actionRef={checkRelationRef}
|
||||
columns={columns}
|
||||
size='small'
|
||||
className="searchH"
|
||||
search={false}
|
||||
request={async (params) =>
|
||||
await describeSiteMsg(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
return Promise.resolve({
|
||||
data: res.records,
|
||||
// success: res.success,
|
||||
total: res.total,
|
||||
current: res.current,
|
||||
});
|
||||
}
|
||||
return Promise.resolve({
|
||||
data: [],
|
||||
success: false,
|
||||
total: 0,
|
||||
current: 1,
|
||||
});
|
||||
})
|
||||
}
|
||||
pagination={{ defaultPageSize: 10, showSizeChanger: false }}//默认显示条数
|
||||
toolBarRender={false}
|
||||
/>
|
||||
</Spin>
|
||||
</Card>
|
||||
{messageDetail ? <MessageDetail messId={messId} onCancel={() => { setMessageDetail(false), checkRelationRef.current?.reload() }} modalVisible={messageDetail} /> : null}
|
||||
{questVisible ? <QuestDetail questData={questData} onCancel={() => { setQuestVisible(false), checkRelationRef.current?.reload() }} modalVisible={questVisible} /> : null}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default FilesList;
|
46
src/pages/SystemMessage/message/service.ts
Normal file
46
src/pages/SystemMessage/message/service.ts
Normal file
@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//系统消息列表
|
||||
export async function describeSiteMsg(data: any) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/message/describeSiteMsg', {
|
||||
method: 'post',
|
||||
data: {
|
||||
pageNo: data?.current,
|
||||
pageSize: data?.pageSize
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
//新增角色列表
|
||||
export async function describeSiteMsgDetail(msId: any) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/message/describeSiteMsgDetail/' + msId, {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
// 系统消息已读
|
||||
export async function selectMsgRead(id: any) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/message/selectMsgRead/' + id, {
|
||||
method: 'GET',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询项目信息
|
||||
* @param id
|
||||
*/
|
||||
export function getProjectById(id: any) {
|
||||
return request('/api/biz-service-ebtp-project/v1/projectRecord/' + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询问卷数据
|
||||
* @param params {id: string}
|
||||
*/
|
||||
export async function getQuestList(params?: any) {
|
||||
return request(`/api/biz-service-ebtp-quest/mongdb/questForm/findQuestFormForUser`, {
|
||||
method: 'POST',
|
||||
requestType: 'form',
|
||||
data: params,
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user