|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<view class="container">
|
|
|
- <view class="message" v-for="(item,index) in messageList" :key="item.id" @click="goToMessageDetail(item)">
|
|
|
+ <view class="message" v-for="(item,index) in messageList" :key="item.id" @click="setRead(item,0)">
|
|
|
<view class="message-cons">
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view class="messageTitle">{{item.notice.title}}</view>
|
|
@@ -18,7 +18,7 @@
|
|
|
<view class="flex align_center justify_between">
|
|
|
<view class="messageTime flex_1">{{item.notice.releaseDate}}</view>
|
|
|
<view v-if="item.notice.type == 'tx'">
|
|
|
- <u-button @click.stop="toAction(item)" shape="circle" plain size="mini" type="primary">
|
|
|
+ <u-button @click.stop="setRead(item,1)" shape="circle" plain size="mini" type="primary">
|
|
|
{{ item.notice.extInfo.bizType == 'SHELF_REPLENISH' ? '立即处理':'点击查看' }}
|
|
|
</u-button>
|
|
|
</view>
|
|
@@ -26,7 +26,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nodata">
|
|
|
- <u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="150" text="暂无数据" img-width="120" v-if="messageList.length==0 && status!='loading'" mode="list"></u-empty>
|
|
|
+ <u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" :margin-top="100" icon-size="150" text="暂无数据" img-width="120" v-if="messageList.length==0 && status!='loading'" mode="list"></u-empty>
|
|
|
<u-loadmore :load-text="$config('loadText')" class="loadmore" v-if="total>pageSize || status=='loading'" :status="status" />
|
|
|
</view>
|
|
|
</view>
|
|
@@ -87,6 +87,12 @@
|
|
|
pageSize: this.pageSize
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
+ res.data.list.map(item => {
|
|
|
+ if(item.notice.type == 'tx'){
|
|
|
+ item.notice.extInfo = JSON.parse(item.notice.extInfo)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
if(this.pageNo>1){
|
|
|
this.messageList = this.messageList.concat(res.data.list || [])
|
|
|
}else{
|
|
@@ -102,52 +108,55 @@
|
|
|
})
|
|
|
}
|
|
|
this.status = "loadmore"
|
|
|
-
|
|
|
- this.messageList.map(item => {
|
|
|
- if(item.notice.type == 'tx'){
|
|
|
- item.notice.extInfo = JSON.parse(item.notice.extInfo)
|
|
|
- }
|
|
|
- })
|
|
|
})
|
|
|
},
|
|
|
- setRead(item){
|
|
|
+ setRead(data,type){
|
|
|
//设置为已读
|
|
|
- if (item.readFlag==0){
|
|
|
- hasRead({msg_id: item.id}).then(res => {
|
|
|
+ if (data.readFlag==0){
|
|
|
+ hasRead({msg_id: data.id}).then(res => {
|
|
|
// 刷新列表
|
|
|
if (res.status == 200){
|
|
|
this.pageInit()
|
|
|
+ if(data.notice&&data.notice.type == 'tx' && type == 1){
|
|
|
+ this.toAction(data)
|
|
|
+ }else{
|
|
|
+ this.goToMessageDetail(data)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
+ }else{
|
|
|
+ if(data.notice&&data.notice.type == 'tx' && type == 1){
|
|
|
+ this.toAction(data)
|
|
|
+ }else{
|
|
|
+ this.goToMessageDetail(data)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 查看详细
|
|
|
- goToMessageDetail(item){
|
|
|
- this.setRead(item)
|
|
|
+ goToMessageDetail(data){
|
|
|
// 跳转到详细页
|
|
|
uni.navigateTo({
|
|
|
- url:'./xtNoticeDetail/xtNoticeDetail?item='+ encodeURIComponent(JSON.stringify(item))
|
|
|
+ url:'./xtNoticeDetail/xtNoticeDetail?item='+ encodeURIComponent(JSON.stringify(data))
|
|
|
})
|
|
|
},
|
|
|
toAction (data) {
|
|
|
- this.setRead(data)
|
|
|
- // 急送订单
|
|
|
- if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
|
|
|
- uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify({ salesBillSn: data.notice.extInfo.bizSn }) })
|
|
|
- }
|
|
|
- // 补货订单
|
|
|
- if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
|
|
|
- uni.navigateTo({ url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CONFIRM' })
|
|
|
- }
|
|
|
- // 货架订单
|
|
|
- if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
|
|
|
- uni.navigateTo({ url: '/pages/shelfOrder/orderDetail?pageType=detail&orderBillSn='+data.notice.extInfo.bizSn })
|
|
|
- }
|
|
|
- // 货架异常
|
|
|
- if (data.notice.extInfo.bizType == 'SHELF_WARN') {
|
|
|
- const shelfName = data.notice.plainContent.split('已经超过')[0]
|
|
|
- uni.navigateTo({ url: '/pages/shelfOrder/shelfOrder?bizType=SHELF_WARN&shelfSn='+data.notice.extInfo.bizSn+'&shelfName='+shelfName })
|
|
|
- }
|
|
|
+ // 急送订单
|
|
|
+ if (data.notice.extInfo.bizType == 'TEMP_ORDER') {
|
|
|
+ uni.navigateTo({ url: '/pages/sales/edit?pageType=detail&data='+JSON.stringify({ salesBillSn: data.notice.extInfo.bizSn }) })
|
|
|
+ }
|
|
|
+ // 补货订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_REPLENISH') {
|
|
|
+ uni.navigateTo({ url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CONFIRM' })
|
|
|
+ }
|
|
|
+ // 货架订单
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_ORDER') {
|
|
|
+ uni.navigateTo({ url: '/pages/shelfOrder/orderDetail?pageType=detail&orderBillSn='+data.notice.extInfo.bizSn })
|
|
|
+ }
|
|
|
+ // 货架异常
|
|
|
+ if (data.notice.extInfo.bizType == 'SHELF_WARN') {
|
|
|
+ const shelfName = data.notice.plainContent.split('已经超过')[0]
|
|
|
+ uni.navigateTo({ url: '/pages/shelfOrder/shelfOrder?bizType=SHELF_WARN&shelfSn='+data.notice.extInfo.bizSn+'&shelfName='+shelfName })
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
onLoad() {
|