Commit f5fa1526 by yiyu.li

一些优化

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