Commit 7c7a6aee authored by kaitly205422@163.com's avatar kaitly205422@163.com

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/rongtong-app into develop

parents 9e33fff9 bd13b279
......@@ -31,7 +31,7 @@ export default {
imgUrl: require("@/assets/tabBar/new.png"),
imgUrlActive: require("@/assets/tabBar/new-active.png"),
path: "/message-center",
text: "任务列表"
text: "消息中心"
},
{
key: "2",
......
import request from '@/utils/axios'
import { getFun, postFun,postThree } from "@/service/table.js";
/*get请求*/
// export function getFun(url,params) {
// return request({
// url: url,
// method: 'get',
// params
// })
// }
/* post请求 */
//消息信息列表
export function postMessgaelist(data,params) {
return postThree('/messageInfo/list', data,params)
}
// //消息信息列表
// export function postWarnList(data,params) {
// return postThree('warn/pushBase/list', data,params)
// }
//未读消息变为已读
export function noticeRemove(data) {
return postFun('/messageInfo/changeRead', data)
}
//清除未读消息列表
export function removeAllMessgae(data) {
return postFun("/messageInfo/changeStatus", data)
}
//删除已读消息
export function removeMessgae(data) {
return postFun("/messageInfo/remove", data)
}
//待办事项列表
export function waitList(data,params) {
return postThree("/backlogInfo/list",data,params)
}
//未读消息数
export function badgeNumber(data) {
return getFun("/backlogInfo/unReadCount", data);
}
//删除已办事项
export function removeWaitList(data) {
return postFun("/backlogInfo/remove", data)
}
// //通知公告列表
// export function notificationList(data) {
// return postFun("/noticeInfo/list", data)
// }
// //清除通知公告未读
// export function removeAllNotification(data) {
// return getFun("/noticeInfo/changeStatus", data)
// }
// //清除通知未读改为已读
// export function readNotification(data) {
// return postFun("/noticeInfo/changeRead", data)
// }
// //删除已读通知列表
// export function removeNotification(data) {
// return postFun("/noticeInfo/remove", data)
// }
\ No newline at end of file
......@@ -52,3 +52,13 @@ export function fileDownFuns(url, data) {
responseType: "blob" /*下载文件必填项*/
});
}
/* put请求 */
export function postThree(url,data,params) {
return request({
url:url,
method: 'post',
params,
data,
})
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
<div class="con">
<van-tabs v-model="activeName" color="#247df7" title-inactive-colo="#d0d1d1" title-active-color="#000000" sticky
offset-top="1.333333rem" @change="changeTab">
<van-tab title="消息提醒" name="消息提醒">
<van-tab title="消息提醒(14)" name="消息提醒">
<info-tip></info-tip>
</van-tab>
<!-- <van-tab title="预警提醒" name="预警提醒" >
......@@ -20,7 +20,7 @@
<!-- <van-tab title="SOS求救" name="SOS求救">
<Iso></Iso>
</van-tab> -->
<van-tab title="待办事项" name="待办事项">
<van-tab title="待办事项(20)" name="待办事项">
<wait-event></wait-event>
</van-tab>
</van-tabs>
......@@ -105,7 +105,7 @@ export default {
.con {
// height: calc(100% - 110px);
// height: 100%;
padding: 0 0 50px 0;
// padding: 0 0 50px 0;
background-color: #f0f1f5;
position: relative;
......
......@@ -18,40 +18,59 @@
</div>
<!-- 内容列表 -->
<div class="con-list" @touchmove="showIndex = null">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="getList()"
>
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div class="approval-title">{{ item.noticeTitle }} <span class="title-icon">待处理</span></div>
<!-- <div class="row"><span class="row-title">作业类型</span><span>{{ item.id }}</span></div> -->
<div class="row"><span class="row-title">作业类型</span><span>{{ item.jobType }}</span></div>
<div class="row"><span class="row-title">作业单号</span><span>{{ item.pid }}</span></div>
<div class="row"><span class="row-title">发送人</span><span>{{ item.createName }}</span></div>
<div class="row"><span class="row-title">消息内容</span><span>{{ item.noticeContent }}</span></div>
<div class="row"><span class="row-title">发送时间</span><span>{{ item.sendTime }}</span></div>
<van-tag
class="status"
:color="item.status == '已读' ? '#07c160' : '#ee0a24'"
plain
>
{{ item.status}}
</van-tag>
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="closeOverlay">
<van-button round type="info" @click="onClick(item)">
查看
</van-button>
</div>
</van-overlay>
<van-badge :dot="item.status == 0 ? true : false">
<div style="padding: 10px; min-width: calc(100vw - 1.6rem)">
<div class="messgae-title">
<span>{{ item.title }}</span>
<span>{{ item.createTime }}</span>
</div>
<div class="mse_title">
<!-- {{ item.title }} -->
</div>
<div class="message-content">
{{ item.content }}
</div>
</div>
</van-badge>
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="closeOverlay">
<van-button round color="#4ABD85" @click="touchstart(item)">
详情
</van-button>
</div>
</van-overlay>
</van-cell-group>
<van-image
v-if="messageList.length <= 0"
fit="contain"
:src="require('../../../assets/noMessage.png')"
/>
</van-list>
</div>
</div>
</div>
</template>
<script>
import {
notificationList,
removeAllNotification,
readNotification,
removeNotification,
postMessgaelist
} from "@/service/message";
import { getFun,postFun } from '@/service/table'
import {debounce} from '@/utils/common.js'
export default {
......@@ -77,37 +96,76 @@ export default {
category: "全部"
},
],
loading: false, // 列表滚动到底部会触发load事件
finished: false, // 列表数据全部加载完成
pageSize: 10,
pageNum: 1,
};
},
mounted() {
this.getList(this.searchVal);
},
methods: {
// 搜索事件
// 搜索事件
onSearch:debounce(function(){
if(this.searchVal){
this.getList(this.searchVal)
}else{
this.getList("")
}
this.messageList=[]
this.pageNum=1
this.finished = false
this.loading = true
if (this.activeIndex == 0) {
let formData = new FormData();
formData.append("status", 0);
formData.append("keyword", this.searchVal);
this.getList(formData);
} else if (this.activeIndex == 1) {
let formData = new FormData();
formData.append("status", 1);
formData.append("keyword", this.searchVal);
this.getList(formData);
} else if (this.activeIndex == 2) {
let formData = new FormData();
formData.append("keyword", this.searchVal);
this.getList(formData);
}
},800),
getList(val) {
getList(Data) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
let formdata = new FormData()
formdata.append("search", val);
postFun("mobile/notice", formdata)
.then(res => {
var obj={
pageSize:this.pageSize,
pageNum:this.pageNum,
}
let formData
if (this.activeIndex == 0) {
formData = new FormData();
formData.append("status", 0);
} else if (this.activeIndex == 1) {
formData = new FormData();
formData.append("status", 1);
} else if (this.activeIndex == 2) {
formData = new FormData()
}
if(this.searchVal){
formData.append("keyword", this.searchVal);
}
postMessgaelist(Data?Data:formData,obj).then((res) => {
this.$toast.clear();
this.messageList = res.rows.filter(item => {
return item.status == "未读";
});
this.completeList = res.rows;
// this.messageList = res.rows.filter(item => {
// return item.status == "未读";
// });
this.messageList.push(...res.rows)
this.loading = false;
if (this.messageList.length >= res.total) {
this.finished = true;
}
if(!(this.pageNum*this.pageSize-res.total>=0)){
this.pageNum++;
}
})
.catch(() => {
this.$toast.clear();
......@@ -124,77 +182,19 @@ export default {
closeOverlay() {
this.showIndex = null;
},
onClick(data) {
let updateId = data.id
this.showIndex = null;
if (data.jobType == "" || data.pid == "" || data.noticeTitle == "") return;
// 进入对应的操作页面
switch (data.jobType + "-" + data.noticeTitle) {
// 作业审批的情况
case "动火作业-审批通过": case "动火作业-开始作业": case "动火作业-结束作业":
this.$router.push({
name: "detail-work",
params: {
id: data.pid
}
});
break;
case "有限空间作业-审批通过": case "有限空间作业-开始作业": case "有限空间作业-结束作业":
this.$router.push({
name: "limit-detail",
params: {
id: data.pid
}
});
break;
case "动火作业-问题上报": case "动火作业-问题处置": case "动火作业-督导提醒":
// 把 data.中的pid 改为 id 在跳转
data.id = data.proId
this.$router.push({
name: "prorec-detail",
params: {
data: data
}
});
break;
default:
break;
}
// 把未读的消息改为已读状态
if(data.status == "未读"){
let formdata = new FormData()
formdata.append("id", updateId)
postFun("mobile/updateStatus", formdata )
.then(res => {})
.catch(() => {
this.$toast.fail('状态更新失败');
});
}
},
// 点击类别
clickCategory(index, data) {
// 关闭遮罩层
this.showIndex = null;
this.activeIndex = index;
this.activeVal = this.messageCategory[index].category;
// 过滤数组
switch (this.activeVal) {
case "未读":
this.messageList = this.completeList.filter(item => {
return item.status == "未读";
});
break;
case "已读":
this.messageList = this.completeList.filter(item => {
return item.status == "已读";
});
console.log(this.messageList);
break;
default:
this.messageList = this.completeList;
break;
}
}
this.reset()
this.getList()
},
reset(){
this.messageList=[]
this.pageNum=1
this.finished = false
this.loading = true
},
}
};
</script>
......
......@@ -7,26 +7,41 @@
</div>
<!-- 内容列表 -->
<div class="con-list" @touchmove="showIndex = null">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
@load="getList()"
>
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div class="approval-title">{{ item.taskName }} <span class="title-icon">待处理</span></div>
<div><span>作业类型</span>{{ item.businessDes }}</div>
<div><span>作业单号</span>{{ item.businessId }}</div>
<div><span>申请人</span>{{ item.createBy }}</div>
<div><span>作业地点</span>{{ item.place }}</div>
<div><span>开始时间</span>{{ item.startTime }}</div>
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="closeOverlay">
<van-button round type="info" @click="onClick(item)">
处理
</van-button>
</div>
</van-overlay>
<van-badge :dot="item.status == 0 ? true : false">
<div style="padding: 10px; min-width: calc(100vw - 1.6rem)">
<div class="messgae-title">
<span>{{ item.title }}</span>
<span>{{ item.createTime }}</span>
</div>
<div class="message-content">
{{ item.content }},{{ item.createBy }}
</div>
<div class="bot_but" v-if=" item.theme != '检查'">
<van-button color="#33CCFF" size="mini">{{
item.status == 0 ? "立即处理" : "待办事项"
}}</van-button>
</div>
</div>
</van-badge>
</van-cell-group>
<van-image
v-if="messageList.length <= 0"
fit="contain"
:src="require('../../../assets/noMessage.png')"
/>
</van-list>
</div>
</div>
</div>
......@@ -34,44 +49,86 @@
<script>
import { getFun,postFun } from '@/service/table'
import { waitList, removeWaitList } from "@/service/message";
import {debounce} from '@/utils/common.js'
export default {
data() {
return {
searchVal: "",
showIndex: null, // 是否显示遮罩层
messageList: []
messageList: [],
loading: false, // 列表滚动到底部会触发load事件
finished: false, // 列表数据全部加载完成
pageSize: 10,
pageNum: 1,
};
},
mounted() {
this.getList(this.searchVal);
},
methods: {
// 搜索事件
onSearch:debounce(function(){
this.getList(this.searchVal)
this.messageList=[]
this.pageNum=1
this.finished = false
this.loading = true
let formData = new FormData();
formData.append("keyword", this.searchVal);
this.getList(formData)
},500),
getList(val) {
getList(Data) {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
});
let formdata = new FormData();
formdata.append("processDefinitionKey", "dhzy_main,yxkj_main");
formdata.append("search", val);
postFun("dhzyreport/list", formdata)
var obj={
pageSize:this.pageSize,
pageNum:this.pageNum,
}
let formData
formData = new FormData();
if(this.searchVal){
formData.append("keyword", this.searchVal);
}
waitList(Data?Data:formData,obj)
.then(res => {
this.messageList = res.data;
this.messageList.push(...res.rows)
this.loading = false;
if (this.messageList.length >= res.total) {
this.finished = true;
}
if(!(this.pageNum*this.pageSize-res.total>=0)){
this.pageNum++;
}
// this.$parent.$parent.$parent.$parent.getBadgeNumber();
})
},
touchstart(index, item) {
console.log('%c [ item ]-104', 'font-size:13px; background:pink; color:#bf2c9f;', item)
if (this.showIndex != null) {
this.showIndex = null;
return;
}
if(item.appUrl){
this.$router.push({
name: item.appUrl,
// name: 'center',
params: {
id: item.pid,
mainId:item.mainId,
path:item.appUrl,
nodeId:item.nodeId,
theme:item.theme
}
// params: {
// id: item.pid,
// pageName:'noticeWait'
// },
})
}
this.showIndex = index;
},
closeOverlay() {
......@@ -80,126 +137,126 @@ export default {
onClick(data) {
this.showIndex = null;
if (data.businessDes == "" || data.taskName == "") return;
// 进入对应的操作页面
switch (data.businessDes + "-" + data.taskName) {
// 作业审批的情况
case "动火作业-作业负责人确认": case "有限空间作业-作业负责人确认":
this.$router.push({
name: "approval-handle",
params: {
data: data
}
});
break;
case "动火作业-项目负责人审批": case "有限空间作业-项目负责人审批":
this.$router.push({
name: "project-handle",
params: {
data: data
}
});
break;
case "动火作业-会签部室会签": case "有限空间作业-会签部室会签":
this.$router.push({
name: "safe-dept-handle",
params: {
data: data
}
});
break;
case "动火作业-安全管理部门审批": case "有限空间作业-安全管理部门审批":
this.$router.push({
name: "safe-officer-handle",
params: {
data: data
}
});
break;
case "动火作业-主管领导审批": case "有限空间作业-主管领导审批":
this.$router.push({
name: "executive-director",
params: {
data: data
}
});
break;
// 现场作业的情况
case "动火作业-重点人员签到":
this.$router.push({
name: "hot-work-confirm",
params: {
data: data
}
});
break;
case "动火作业-现场人员签字":
this.$router.push({
name: "site-confirm",
params: {
data: data
}
});
break;
case "动火作业-结束作业":
this.$router.push({
name: "work-patrol",
params: {
data: data
}
});
break;
case "动火作业-安全部门结束确认":
this.$router.push({
name: "check-accept",
params: {
data: data
}
});
break;
case "有限空间作业-重点人员签到":
this.$router.push({
name: "job-affirm",
params: {
data: data
}
});
break;
case "有限空间作业-交底上传":
this.$router.push({
name: "job-sign",
params: {
data: data
}
});
break;
case "有限空间作业-安全措施确认":
this.$router.push({
name: "safe-disclosure",
params: {
data: data
}
});
break;
case "有限空间作业-作业前确认":
this.$router.push({
name: "begin-work",
params: {
data: data
}
});
break;
// // 进入对应的操作页面
// switch (data.businessDes + "-" + data.taskName) {
// // 作业审批的情况
// case "动火作业-作业负责人确认": case "有限空间作业-作业负责人确认":
// this.$router.push({
// name: "approval-handle",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-项目负责人审批": case "有限空间作业-项目负责人审批":
// this.$router.push({
// name: "project-handle",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-会签部室会签": case "有限空间作业-会签部室会签":
// this.$router.push({
// name: "safe-dept-handle",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-安全管理部门审批": case "有限空间作业-安全管理部门审批":
// this.$router.push({
// name: "safe-officer-handle",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-主管领导审批": case "有限空间作业-主管领导审批":
// this.$router.push({
// name: "executive-director",
// params: {
// data: data
// }
// });
// break;
// // 现场作业的情况
// case "动火作业-重点人员签到":
// this.$router.push({
// name: "hot-work-confirm",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-现场人员签字":
// this.$router.push({
// name: "site-confirm",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-结束作业":
// this.$router.push({
// name: "work-patrol",
// params: {
// data: data
// }
// });
// break;
// case "动火作业-安全部门结束确认":
// this.$router.push({
// name: "check-accept",
// params: {
// data: data
// }
// });
// break;
// case "有限空间作业-重点人员签到":
// this.$router.push({
// name: "job-affirm",
// params: {
// data: data
// }
// });
// break;
// case "有限空间作业-交底上传":
// this.$router.push({
// name: "job-sign",
// params: {
// data: data
// }
// });
// break;
// case "有限空间作业-安全措施确认":
// this.$router.push({
// name: "safe-disclosure",
// params: {
// data: data
// }
// });
// break;
// case "有限空间作业-作业前确认":
// this.$router.push({
// name: "begin-work",
// params: {
// data: data
// }
// });
// break;
case "有限空间作业-结束作业":
this.$router.push({
name: "end-work",
params: {
data: data
}
});
break;
default:
break;
}
// case "有限空间作业-结束作业":
// this.$router.push({
// name: "end-work",
// params: {
// data: data
// }
// });
// break;
// default:
// break;
// }
},
}
};
......@@ -207,13 +264,31 @@ export default {
<style lang="less" scoped>
/* @import url(); 引入css类 */
.message-wrap {
min-height: 58vh;
padding: 10px 10px 0;
background-color: #f0f1f5;
// 标签
.category-wrap {
.my-tag-style {
width: 75px;
height: 21px;
font-size: 13px;
border: 1px solid #1989fa;
border-radius: 4px;
color: #1989fa;
display: inline-block;
text-align: center;
line-height: 21px;
margin-right: 10px;
}
.active {
color: white;
background-color: #1989fa;
}
}
// 搜索
.search-wrap {
margin: 0 0 0.26667rem 0;
margin: 10px 0;
.van-search {
border-radius: 5px;
padding: 5px 12px;
......@@ -226,52 +301,21 @@ export default {
.con-list {
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.266667rem;
padding: 0.266667rem;
position: relative;
.approval-title{
font-weight: bold;
color: #000;
.title-icon{
text-align: center !important;
font-weight: normal;
background-color: #2980f7;
color: white;
font-size: .32rem;
padding: .026667rem .08rem;
height: -webkit-fill-available;
display: inline;
margin-left: .266667rem;
position: relative;
top: -0.026667rem;
}
margin-bottom: 10px;
font-size: 13px;
padding: 10px;
.message-content {
margin-top: 10px;
}
div {
line-height: 0.7rem;
font-size: 0.4rem;
span {
width: 1.733333rem;
display: inline-block;
text-align-last: justify;
}
}
.operation {
text-align: right;
margin-right: 5px;
color: #2980f7;
font-weight: normal;
.messgae-title {
display: flex;
justify-content: space-between;
align-items: center;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
.van-button__text {
width: initial;
}
}
.bot_but {
display: flex;
justify-content: right;
align-items: center;
}
}
}
......
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