Commit 9478fe25 authored by Bill's avatar Bill

fix: 添加消息全部已读,修改加工详情

parent f79db54e
......@@ -72,6 +72,13 @@ const EXAM_SERVICE = {
}
const { TabPane } = Tabs;
enum SourceEnum {
order = 1,
product = 2,
}
const Detail: React.FC<{}> = () => {
const pathname = history.location.pathname;
const isSupplier = pathname.includes('assign') ;
......@@ -110,6 +117,8 @@ const Detail: React.FC<{}> = () => {
}
return res;
}, [info])
// 生产通知单收发货明细 columns
const receiptAndDeliveryDetailsColumns = info.source === SourceEnum.order ? pnoReceiveDeliverDetailDOListColumns : pnoReceiveDeliverDetailDOListColumns.slice(1);
const getInfo = () => {
const service = SERVICE_MAP[pathname];
......@@ -359,7 +368,7 @@ const Detail: React.FC<{}> = () => {
<Descriptions.Item span={3} label="通知单摘要:" style={{overflow: 'hidden'}}>{info?.summary}</Descriptions.Item>
<Descriptions.Item label="加工企业:">{info?.processName}</Descriptions.Item>
<Descriptions.Item label="单据时间:">{info && info.createTime && moment(info.createTime).format('YYYY-MM-DD') || null }</Descriptions.Item>
<Descriptions.Item label="通知单来源:">{info?.source == '1' ? '订单加工': '商品加工'}</Descriptions.Item>
<Descriptions.Item label="通知单来源:">{info?.source === SourceEnum.order ? '订单加工': '商品加工'}</Descriptions.Item>
<Descriptions.Item label="外部状态:">
<StatusTag type={SUPPLIER_OUTER_STATUS_COLOR[info.outerStatus]} title={info.outerStatusName} />
</Descriptions.Item>
......@@ -424,7 +433,7 @@ const Detail: React.FC<{}> = () => {
<div style={{marginTop: '20px'}}>
<Card>
<h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1>
<Table rowKey={"id"} dataSource={info?.details} columns={info.source === 2 ? orderDetailColumn : columns}/>
<Table rowKey={"id"} dataSource={info?.details} columns={info.source === SourceEnum.order ? columns : orderDetailColumn}/>
</Card>
</div>
......@@ -433,13 +442,13 @@ const Detail: React.FC<{}> = () => {
info && info.outerTaskType !== 29
? <div style={{marginTop: '20px'}}>
<ReceiptDeliveryDetailsCard>
<StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === 2 ? 'product' : 'order')} dataSource={info.details}></StatisticsTab>
<StatisticsTab tab="收发货统计" columns={receiveColumns(info.source === SourceEnum.order ? 'order' : 'product')} dataSource={info.details}></StatisticsTab>
{
info.pnoReceiveDeliverDetailDOList &&
info.pnoReceiveDeliverDetailDOList.length > 0
? <DetailTab
tab="收发货明细"
columns={pnoReceiveDeliverDetailDOListColumns}
columns={receiptAndDeliveryDetailsColumns}
dataSource={info.pnoReceiveDeliverDetailDOList}
handleConfirm={handleConfirm}
/>
......
......@@ -136,7 +136,6 @@ const DetailTab: React.FC<Iprops> = (props) => {
<span className={styles.title}>内部状态</span>
<span className={styles.value}>{
INNER_TEXT[`${activeData.deliverStatus}_${activeData.receiveStatus}_${activeData.receiptStatus}`]
}</span>
</div>
</Col>
......
......@@ -38,8 +38,7 @@ const Message: React.FC<{}> = () => {
}
const handleRead = (id, url: string) => {
console.log(url);
PublicApi.getReportMessageMemberRead({id: id})
PublicApi.postReportMessageMemberRead({id: id})
.then((data) => {
if(url) {
if(/http/.test(url)) {
......@@ -52,6 +51,14 @@ const Message: React.FC<{}> = () => {
}
})
}
const handleAllMessageRead = () => {
PublicApi.postReportMessageMemberReadAll()
.then((data) => {
if(data.code === 1000) {
getList(pagination)
}
})
}
const renderMessage = (data) => {
const type = data.type
......@@ -73,7 +80,7 @@ const Message: React.FC<{}> = () => {
<Card
title="消息列表"
extra={(
<div><Button type="link">全部已读</Button></div>
<div><Button type="link" onClick={handleAllMessageRead}>全部已读</Button></div>
)}
>
<List
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment