|
@@ -16,8 +16,7 @@
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" class="userinfo">
|
|
<el-col :span="6" class="userinfo">
|
|
- <!-- :value="messageCount[0] == 0 ? false : messageCount[0]" -->
|
|
|
|
- <el-badge class="itemNew">
|
|
|
|
|
|
+ <el-badge class="itemNew" :value="unreadCount[3]">
|
|
<i class="el-icon-message-solid" style="font-size:24px" v-popover:popover1></i>
|
|
<i class="el-icon-message-solid" style="font-size:24px" v-popover:popover1></i>
|
|
<!-- 消息中心 -->
|
|
<!-- 消息中心 -->
|
|
<el-popover
|
|
<el-popover
|
|
@@ -32,11 +31,11 @@
|
|
<!-- 审批的页面 -->
|
|
<!-- 审批的页面 -->
|
|
<el-tab-pane name="0">
|
|
<el-tab-pane name="0">
|
|
<span slot="label">
|
|
<span slot="label">
|
|
- <span v-if="messageCount[1] == 0">审批</span>
|
|
|
|
- <span v-else>审批({{messageCount[1]}})</span>
|
|
|
|
|
|
+ <span v-if="unreadCount[0] == 0">审批</span>
|
|
|
|
+ <span v-else>审批({{unreadCount[0]}})</span>
|
|
</span>
|
|
</span>
|
|
- <div class="popover-item" v-if="popoverData.length == 0">暂无审批消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData">
|
|
|
|
|
|
+ <div class="popover-item" v-if="unreadCount[0] == 0">暂无审批消息</div>
|
|
|
|
+ <div class="popover-item" v-for="item in popoverData[0]">
|
|
<p class="popover-title">
|
|
<p class="popover-title">
|
|
<span
|
|
<span
|
|
style="cursor: pointer;"
|
|
style="cursor: pointer;"
|
|
@@ -50,11 +49,11 @@
|
|
<!-- 警告的页面 -->
|
|
<!-- 警告的页面 -->
|
|
<el-tab-pane name="1">
|
|
<el-tab-pane name="1">
|
|
<span slot="label">
|
|
<span slot="label">
|
|
- <span v-if="messageCount[2] == 0">警告</span>
|
|
|
|
- <span v-else>警告{{messageCount[2]}})</span>
|
|
|
|
|
|
+ <span v-if="unreadCount[1] == 0">警告</span>
|
|
|
|
+ <span v-else>警告({{unreadCount[1]}})</span>
|
|
</span>
|
|
</span>
|
|
- <div class="popover-item" v-if="popoverData.length == 0">暂无警告消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData">
|
|
|
|
|
|
+ <div class="popover-item" v-if="unreadCount[1] == 0">暂无警告消息</div>
|
|
|
|
+ <div class="popover-item" v-for="item in popoverData[1]">
|
|
<p class="popover-title">
|
|
<p class="popover-title">
|
|
<span
|
|
<span
|
|
style="cursor: pointer;"
|
|
style="cursor: pointer;"
|
|
@@ -68,11 +67,11 @@
|
|
<!-- 保养的页面 -->
|
|
<!-- 保养的页面 -->
|
|
<el-tab-pane name="2">
|
|
<el-tab-pane name="2">
|
|
<span slot="label">
|
|
<span slot="label">
|
|
- <span v-if="messageCount[3] == 0">保养</span>
|
|
|
|
- <span v-else>保养{{messageCount[3]}})</span>
|
|
|
|
|
|
+ <span v-if="unreadCount[2] == 0">保养</span>
|
|
|
|
+ <span v-else>保养({{unreadCount[2]}})</span>
|
|
</span>
|
|
</span>
|
|
- <div class="popover-item" v-if="popoverData.length == 0">暂无保养消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData">
|
|
|
|
|
|
+ <div class="popover-item" v-if="unreadCount[2] == 0">暂无保养消息</div>
|
|
|
|
+ <div class="popover-item" v-for="item in popoverData[2]">
|
|
<p class="popover-title">
|
|
<p class="popover-title">
|
|
<span
|
|
<span
|
|
style="cursor: pointer;"
|
|
style="cursor: pointer;"
|
|
@@ -293,9 +292,8 @@ export default {
|
|
},
|
|
},
|
|
//消息数据
|
|
//消息数据
|
|
popoverData: [],
|
|
popoverData: [],
|
|
- tips: false,
|
|
|
|
- activePage: 0,
|
|
|
|
- messageCount: [0, 0, 0, 0]
|
|
|
|
|
|
+ unreadCount: [],
|
|
|
|
+ activePage: 0
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -436,8 +434,17 @@ export default {
|
|
},
|
|
},
|
|
res => {
|
|
res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
- this.popoverData = res.data.list.list;
|
|
|
|
- this.tips = res.data.isRedPoint;
|
|
|
|
|
|
+ this.popoverData = [];
|
|
|
|
+ this.popoverData.push(res.data[0].emergencyList.list);
|
|
|
|
+ this.popoverData.push(res.data[1].emergencyList.list);
|
|
|
|
+ this.popoverData.push(res.data[2].emergencyList.list);
|
|
|
|
+ this.unreadCount = [];
|
|
|
|
+ this.unreadCount.push(res.data[0].isNotReadCount);
|
|
|
|
+ this.unreadCount.push(res.data[1].isNotReadCount);
|
|
|
|
+ this.unreadCount.push(res.data[2].isNotReadCount);
|
|
|
|
+ this.unreadCount.push(
|
|
|
|
+ this.unreadCount[0] + this.unreadCount[1] + this.unreadCount[2]
|
|
|
|
+ );
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
message: res.msg,
|
|
message: res.msg,
|
|
@@ -487,79 +494,12 @@ export default {
|
|
this.$router.push("/detection/" + id);
|
|
this.$router.push("/detection/" + id);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- //检查是否要进行报废提示
|
|
|
|
- checkDiscardNotice() {
|
|
|
|
- this.http.post(
|
|
|
|
- this.port.mold.moldDiscardListGet,
|
|
|
|
- {},
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- //说明有东西需要保养
|
|
|
|
- if (res.data.length > 0) {
|
|
|
|
- this.notify("报废");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.editLoading = false;
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- //检查是否要进行保养提示
|
|
|
|
- checkMaintainNotice() {
|
|
|
|
- this.http.post(
|
|
|
|
- this.port.mold.moldMaintainListGet,
|
|
|
|
- {},
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- //说明有东西需要保养
|
|
|
|
- if (res.data.length > 0) {
|
|
|
|
- this.notify("保养");
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.editLoading = false;
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- //右上角弹窗警告
|
|
|
|
- notify(action) {
|
|
|
|
- this.$notify({
|
|
|
|
- title: "有模具需要" + action,
|
|
|
|
- message: "请到消息列表中查看",
|
|
|
|
- type: "warning",
|
|
|
|
- duration: 0
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
//标签页面切换时
|
|
//标签页面切换时
|
|
handleClick(tab, event) {
|
|
handleClick(tab, event) {
|
|
this.activeTab = tab.name;
|
|
this.activeTab = tab.name;
|
|
- // this.getOperationRecord(this.activeTab);//应该是取得对应的消息
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- //告警 保养的烦人弹窗警告 先不弹出了
|
|
|
|
- // this.checkMaintainNotice();
|
|
|
|
- // this.checkDiscardNotice();
|
|
|
|
if (this.user) {
|
|
if (this.user) {
|
|
var user = JSON.parse(this.user);
|
|
var user = JSON.parse(this.user);
|
|
this.user = user;
|
|
this.user = user;
|