|
@@ -30,11 +30,13 @@
|
|
|
><i class="el-icon-search"></i>查询物资</el-button
|
|
|
>
|
|
|
</el-form-item>
|
|
|
- <el-form-item
|
|
|
- ><el-button type="primary" class="btn" @click="refresh">
|
|
|
- <i class="el-icon-refresh"></i>刷新
|
|
|
- </el-button></el-form-item
|
|
|
- >
|
|
|
+ <el-form-item>
|
|
|
+ <el-badge :value="redDotNum" class="item">
|
|
|
+ <el-button type="primary" class="btn" @click="refresh">
|
|
|
+ <i class="el-icon-refresh"></i>刷新
|
|
|
+ </el-button>
|
|
|
+ </el-badge>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item
|
|
|
><el-button type="primary" class="btn" @click="allow">
|
|
|
<i class="el-icon-d-arrow-right"></i>放行
|
|
@@ -252,35 +254,62 @@ export default {
|
|
|
//物资信息查询内容
|
|
|
materialNameText: null,
|
|
|
materialSpecificationText: null,
|
|
|
- materialModelText: null
|
|
|
+ materialModelText: null,
|
|
|
+ timer: null,
|
|
|
+ totalQueueNum: null,
|
|
|
+ redDotNum: null,
|
|
|
+ i: 0,
|
|
|
+ totalQueueNumFirst: null
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
- this.myWebsocket();
|
|
|
+ // this.myWebsocket();
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.i = 0;
|
|
|
this.infomation();
|
|
|
this.getSpellingArray();
|
|
|
this.getNoSpellingArray();
|
|
|
this.wantEnfactory();
|
|
|
+ this.start();
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ wantS() {
|
|
|
+ return this.totalQueueNum;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ this.timer;
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ wantS() {
|
|
|
+ if (this.totalQueueNum - this.totalQueueNumFirst > 0) {
|
|
|
+ this.redDotNum = this.totalQueueNum - this.totalQueueNumFirst;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- // computed: {
|
|
|
- // wantS() {
|
|
|
- // return this.totalNoEntryTime;
|
|
|
- // }
|
|
|
- // },
|
|
|
methods: {
|
|
|
- // myWebsocket() {
|
|
|
- // let wss = new WebSocket("wss:wl.dasteel.cn:32322/websocket/socketServer");
|
|
|
- // },
|
|
|
wantEnfactory() {
|
|
|
this.axios.get("/api/v1/uc/getQueueCount").then(res => {
|
|
|
- console.log(res.data);
|
|
|
+ this.totalQueueNum = res.data.data;
|
|
|
+ console.log(this.totalQueueNum, "totalQueueNum");
|
|
|
+ if (this.i == 0) {
|
|
|
+ this.totalQueueNumFirst = this.totalQueueNum;
|
|
|
+ console.log(this.totalQueueNumFirst, "totalQueuefIRST");
|
|
|
+ }
|
|
|
+ this.i++;
|
|
|
});
|
|
|
},
|
|
|
+ start() {
|
|
|
+ this.timer = setInterval(this.wantEnfactory, 60000);
|
|
|
+ },
|
|
|
refresh() {
|
|
|
this.getSpellingArray();
|
|
|
this.getNoSpellingArray();
|
|
|
+ this.redDotNum = null;
|
|
|
+ this.totalQueueNumFirst = this.totalQueueNum;
|
|
|
+ clearInterval(this.timer);
|
|
|
+ this.start();
|
|
|
},
|
|
|
getRowKey(row) {
|
|
|
return row.ROW_ID;
|