Commit f5fa1526 by yiyu.li

一些优化

parent ecf40129
......@@ -374,21 +374,28 @@ export default {
).then((res) => {
if (res.data.ret == 1) {
this.stationList = res.data.data;
} else {
this.$Message.error(this.$t(res.data.msg));
this.stationList = [];
}
});
},
change(i) {
this.a = i;
this.getStations(this.productionLine[i].id);
this.orderDetail = {};
},
change2(index) {
this.b = index;
let status = this.stationList[index].status;
this.sectionid = this.stationList[index].section;
this.orderDetail = {};
// status = 2;
// if (status == 3) {
// this.attr1 = true;
// this.tabindex = "2";
this.getRunningDetail(index);
// } else {
// this.attr2 = true;
......@@ -400,7 +407,7 @@ export default {
},
getIndex(name) {
this.tabindex = name;
if(this.tabindex == '2'){
if (this.tabindex == "2") {
this.orderDetail2 = {};
}
this.getStorages();
......@@ -588,7 +595,6 @@ export default {
if (res.data.ret == 1) {
this.$Message.success(this.$t(res.data.msg));
this.orderDetail2 = {};
} else {
this.$Message.error(this.$t(res.data.msg));
}
......
......@@ -339,6 +339,17 @@ export default {
this.initlevel();
this.search();
},
mounted() {
this.timer = setInterval(() => {
this.search();
}, 5000);
},
beforeDestroy() {
if (this.timer) {
// 如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.timer); // 关闭
}
},
methods: {
search() {
// 初始化产线层级
......@@ -408,8 +419,8 @@ export default {
},
exportExcel() {
let data = {
toExcel:1,
section:this.sectionid
toExcel: 1,
section: this.sectionid,
};
this.axios
.request({
......
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