Commit 42a17a38 authored by dcy's avatar dcy

站内信

parent 32825519
......@@ -72,3 +72,10 @@ export function getNotReadInternalMessageTotal(){
}
)
}
export function getRedInternalMessage(query){
return request({
url:'/ecw/internal-message/redInternalMessage',
method:'get',
params:query,
})
}
......@@ -66,18 +66,50 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="viewMessage(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="deleteFn(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<el-dialog
title="站内信"
:visible.sync="dialogVisible"
width="50%">
<div class="from">
<div class="from-item">
<div class="label">标题:</div>
<div class="content">{{publicObj.title}}</div>
</div>
<div class="from-item">
<div class="label">消息分类:</div>
<div class="content">{{type[publicObj.type]}}</div>
</div>
<div class="from-item">
<div class="label">创建时间</div>
<div class="content">{{parseTime(publicObj.createTime)}}</div>
</div>
<div class="from-item">
<div class="label">消息内容:</div>
<div class="content">{{publicObj.content}}</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getMyInternalMessagePage} from "@/api/system/internalMessage";
import { getMyInternalMessagePage ,getRedInternalMessage, deleteInternalMessage} from "@/api/system/internalMessage";
let type = {
1:'订单消息',
2:'出货消息',
3:'提醒消息',
}
export default {
name: "MyInternalMessage",
data() {
......@@ -110,8 +142,16 @@ export default {
},
// 表单参数
form: {},
dialogVisible:false,
publicObj:{},
type,
};
},
computed:{
notMessage() {
return this.$store.state.user.notMessage;
}
},
created() {
this.getList();
},
......@@ -154,9 +194,57 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
viewMessage(e){
viewMessage(row){
this.publicObj = row;
this.dialogVisible = true;
if(row.status == 0)this.setNotMessage(row.id)
},
setNotMessage(id){
getRedInternalMessage({messageId:id}).then(r =>{
console.log(r)
if(r.code === 0){
this.getList()
let num = Number(this.notMessage);
this.$store.commit('NOt_MESSAGE',--num);
}
})
},
deleteFn(row){
this.$confirm(`是否要删除id:[${row.id}]的站内信?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteInternalMessage(row.id).then(r => {
if(r.code === 0){
this.$message({
type: 'success',
message: '删除成功!'
});
this.getList();
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
}
};
</script>
<style lang="scss" scoped>
.from{
.from-item{
display: flex;
margin: 10px 0;
.label{
width:80px;
}
.content{
flex: 1;
}
}
}
</style>
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