|
@@ -6,9 +6,15 @@
|
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
|
<i class="el-icon-search"></i>查询
|
|
|
</el-button>
|
|
|
- <el-button type="primary" @click="Insert" v-if="activeName == 'first'">
|
|
|
- <i class="el-icon-plus"></i>新增
|
|
|
- </el-button>
|
|
|
+ <el-badge
|
|
|
+ :value="addPlanCount"
|
|
|
+ class="item"
|
|
|
+ v-if="activeName == 'first'"
|
|
|
+ style="margin-left:10px">
|
|
|
+ <el-button type="primary" @click="Insert" v-if="activeName == 'first'">
|
|
|
+ <i class="el-icon-plus"></i>新增
|
|
|
+ </el-button>
|
|
|
+ </el-badge>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
title="车辆信息"
|
|
@@ -133,9 +139,11 @@ export default {
|
|
|
//多选的选中的订单id
|
|
|
selectionList: [],
|
|
|
//区别点击的是添加运力,还是修改
|
|
|
- index: null
|
|
|
+ index: null,
|
|
|
// wssUrl: "wss:wl.dasteel.cn:32322/websocket/socketServer",
|
|
|
// actiones: { username: "湘M99999" } //传入后台的数据
|
|
|
+ addPlanCount:0,
|
|
|
+ timer:null,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -184,7 +192,20 @@ export default {
|
|
|
}
|
|
|
// this.initWebSocket();
|
|
|
},
|
|
|
+ mounted(){
|
|
|
+ this.getAddPlan();
|
|
|
+ this.timer=setInterval(this.getAddPlan, 10000);
|
|
|
+ },
|
|
|
+ beforeDestroy(){
|
|
|
+ clearInterval(this.timer);
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ getAddPlan() {
|
|
|
+ this.axios.post( "/api/v1/ams/getPurRequirementList?apiId=431&requirementStatus=1&enableStatus=1&planStatus=2&pageNum=1&pageSize=10").then(res => {
|
|
|
+ console.log("data:",res.data.data);
|
|
|
+ this.addPlanCount = res.data.data.total;
|
|
|
+ });
|
|
|
+ },
|
|
|
//建立websocket连接
|
|
|
initWebSocket() {
|
|
|
//试图调用websocket
|