From 5a49f41ae14d0cc661bde20d1f22040cc8e2c745 Mon Sep 17 00:00:00 2001 From: schry <2433098676@qq.com> Date: Wed, 21 Jun 2023 18:25:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=9F=A5=E8=AF=A2=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/udi/trace/search/index.vue | 37 ++++++++++++++++++------ src/views/udi/trace/searchLive/index.vue | 11 +++---- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/views/udi/trace/search/index.vue b/src/views/udi/trace/search/index.vue index e079ab8..8f571b5 100644 --- a/src/views/udi/trace/search/index.vue +++ b/src/views/udi/trace/search/index.vue @@ -733,10 +733,11 @@ export default { limit: 10, }, manuOrderQuery: { - recordCode: "", + recordCode: null, page: 1, limit: 10, }, + recordCode: null, manuCodeRelQuery: { manuOrderIdFk: null, page: 1, @@ -801,6 +802,7 @@ export default { this.listCodeRel = null; this.loading = true; this.manuOrderQuery.recordCode = this.list.recordCode + console.log(this.manuOrderQuery.recordCode); getTraceManuOrderList(this.manuOrderQuery).then((res) => { this.loading = false; if (res.code === 20000) { @@ -822,14 +824,16 @@ export default { orderTimeOut() { // 执行逻辑代码 this.filterQuery.page = 1; - this.getList() - if(!(this.list == undefined || this.list.length <= 0)){ - this.manuOrderQuery.recordCode = this.list.recordCode - this.getManuOrderList() + + if((this.list == undefined || this.list.length <= 0)){ + this.getList() + if (this.manuOrderQuery.recordCode != null || this.manuOrderQuery.recordCode != "") { + this.getManuOrderList() + } } // 使用递归法定时执行定时器 if(this.list == undefined || this.list.length <= 0){ - this.monitorOrder = setTimeout(this.orderTimeOut, 1000); + this.monitorOrder = setTimeout(this.orderTimeOut, 10000); } }, formaterSourceType(row){ @@ -991,7 +995,12 @@ export default { page: 1, limit: 10, }; - this.list = null, + this.manuOrderQuery = { + recordCode: null, + page: 1, + limit: 10, + }, + this.list = "", this.listOrder = null, this.listCodeRel = null, clearTimeout(this.monitorOrder); @@ -999,8 +1008,13 @@ export default { //this.total = 0 }, onSubmit() { + // if(this.list != undefined || this.list.length > 0){ + // clearTimeout(this.monitorOrder); + // this.monitorOrder = "" + // }else { + // this.orderTimeOut() + // } this.orderTimeOut() - }, getList() { this.loading = true; @@ -1009,7 +1023,8 @@ export default { if (res.code === 20000) { this.list = res.data || []; this.total = res.data.total || 0; - console.log(this.list) + this.recordCode = res.data.recordCode + console.log(this.recordCode) } else { this.$message.error(res.message); this.list = []; @@ -1025,6 +1040,10 @@ export default { }, created() { this.getCompanyName() + if (this.list > 0) { + clearTimeout(this.monitorOrder); + this.monitorOrder = "" + } }, beforeDestroy() { if (this.monitorOrder) { diff --git a/src/views/udi/trace/searchLive/index.vue b/src/views/udi/trace/searchLive/index.vue index 7fb03ae..b743a9d 100644 --- a/src/views/udi/trace/searchLive/index.vue +++ b/src/views/udi/trace/searchLive/index.vue @@ -857,14 +857,15 @@ export default { orderTimeOut() { // 执行逻辑代码 this.filterQuery.page = 1; - this.getList() - if (!(this.list == undefined || this.list.length <= 0)) { - this.manuOrderQuery.recordCode = this.list.recordCode - this.getManuOrderList() + if ((this.list == undefined || this.list.length <= 0)) { + this.getList() + if (this.manuOrderQuery.recordCode != null || this.manuOrderQuery.recordCode != "") { + this.getManuOrderList() + } } // 使用递归法定时执行定时器 if (this.list == undefined || this.list.length <= 0) { - this.monitorOrder = setTimeout(this.orderTimeOut, 1000); + this.monitorOrder = setTimeout(this.orderTimeOut, 10000); } }, formaterSourceType(row) {