Commit 9478fe25 authored by Bill's avatar Bill

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

parent f79db54e
...@@ -72,6 +72,13 @@ const EXAM_SERVICE = { ...@@ -72,6 +72,13 @@ const EXAM_SERVICE = {
} }
const { TabPane } = Tabs; const { TabPane } = Tabs;
enum SourceEnum {
order = 1,
product = 2,
}
const Detail: React.FC<{}> = () => { const Detail: React.FC<{}> = () => {
const pathname = history.location.pathname; const pathname = history.location.pathname;
const isSupplier = pathname.includes('assign') ; const isSupplier = pathname.includes('assign') ;
...@@ -110,6 +117,8 @@ const Detail: React.FC<{}> = () => { ...@@ -110,6 +117,8 @@ const Detail: React.FC<{}> = () => {
} }
return res; return res;
}, [info]) }, [info])
// 生产通知单收发货明细 columns
const receiptAndDeliveryDetailsColumns = info.source === SourceEnum.order ? pnoReceiveDeliverDetailDOListColumns : pnoReceiveDeliverDetailDOListColumns.slice(1);
const getInfo = () => { const getInfo = () => {
const service = SERVICE_MAP[pathname]; const service = SERVICE_MAP[pathname];
...@@ -359,7 +368,7 @@ const Detail: React.FC<{}> = () => { ...@@ -359,7 +368,7 @@ const Detail: React.FC<{}> = () => {
<Descriptions.Item span={3} label="通知单摘要:" style={{overflow: 'hidden'}}>{info?.summary}</Descriptions.Item> <Descriptions.Item span={3} label="通知单摘要:" style={{overflow: 'hidden'}}>{info?.summary}</Descriptions.Item>
<Descriptions.Item label="加工企业:">{info?.processName}</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 && 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="外部状态:"> <Descriptions.Item label="外部状态:">
<StatusTag type={SUPPLIER_OUTER_STATUS_COLOR[info.outerStatus]} title={info.outerStatusName} /> <StatusTag type={SUPPLIER_OUTER_STATUS_COLOR[info.outerStatus]} title={info.outerStatusName} />
</Descriptions.Item> </Descriptions.Item>
...@@ -424,7 +433,7 @@ const Detail: React.FC<{}> = () => { ...@@ -424,7 +433,7 @@ const Detail: React.FC<{}> = () => {
<div style={{marginTop: '20px'}}> <div style={{marginTop: '20px'}}>
<Card> <Card>
<h1 style={{fontSize: '16px', marginBottom: '16px'}}><strong>通知单明细</strong></h1> <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> </Card>
</div> </div>
...@@ -433,13 +442,13 @@ const Detail: React.FC<{}> = () => { ...@@ -433,13 +442,13 @@ const Detail: React.FC<{}> = () => {
info && info.outerTaskType !== 29 info && info.outerTaskType !== 29
? <div style={{marginTop: '20px'}}> ? <div style={{marginTop: '20px'}}>
<ReceiptDeliveryDetailsCard> <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 &&
info.pnoReceiveDeliverDetailDOList.length > 0 info.pnoReceiveDeliverDetailDOList.length > 0
? <DetailTab ? <DetailTab
tab="收发货明细" tab="收发货明细"
columns={pnoReceiveDeliverDetailDOListColumns} columns={receiptAndDeliveryDetailsColumns}
dataSource={info.pnoReceiveDeliverDetailDOList} dataSource={info.pnoReceiveDeliverDetailDOList}
handleConfirm={handleConfirm} handleConfirm={handleConfirm}
/> />
......
...@@ -136,7 +136,6 @@ const DetailTab: React.FC<Iprops> = (props) => { ...@@ -136,7 +136,6 @@ const DetailTab: React.FC<Iprops> = (props) => {
<span className={styles.title}>内部状态</span> <span className={styles.title}>内部状态</span>
<span className={styles.value}>{ <span className={styles.value}>{
INNER_TEXT[`${activeData.deliverStatus}_${activeData.receiveStatus}_${activeData.receiptStatus}`] INNER_TEXT[`${activeData.deliverStatus}_${activeData.receiveStatus}_${activeData.receiptStatus}`]
}</span> }</span>
</div> </div>
</Col> </Col>
......
...@@ -38,8 +38,7 @@ const Message: React.FC<{}> = () => { ...@@ -38,8 +38,7 @@ const Message: React.FC<{}> = () => {
} }
const handleRead = (id, url: string) => { const handleRead = (id, url: string) => {
console.log(url); PublicApi.postReportMessageMemberRead({id: id})
PublicApi.getReportMessageMemberRead({id: id})
.then((data) => { .then((data) => {
if(url) { if(url) {
if(/http/.test(url)) { if(/http/.test(url)) {
...@@ -52,6 +51,14 @@ const Message: React.FC<{}> = () => { ...@@ -52,6 +51,14 @@ const Message: React.FC<{}> = () => {
} }
}) })
} }
const handleAllMessageRead = () => {
PublicApi.postReportMessageMemberReadAll()
.then((data) => {
if(data.code === 1000) {
getList(pagination)
}
})
}
const renderMessage = (data) => { const renderMessage = (data) => {
const type = data.type const type = data.type
...@@ -73,7 +80,7 @@ const Message: React.FC<{}> = () => { ...@@ -73,7 +80,7 @@ const Message: React.FC<{}> = () => {
<Card <Card
title="消息列表" title="消息列表"
extra={( extra={(
<div><Button type="link">全部已读</Button></div> <div><Button type="link" onClick={handleAllMessageRead}>全部已读</Button></div>
)} )}
> >
<List <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