From 21ee09cc44f93bda0185dd83fe5800182fb77044 Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 16 Aug 2024 16:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weiyang/AppWorkOrder/AppWorkOrder.vue | 10 ++++------ src/project/weiyang/AppWorkOrder/List.vue | 20 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/project/weiyang/AppWorkOrder/AppWorkOrder.vue b/src/project/weiyang/AppWorkOrder/AppWorkOrder.vue index 70c96f6..0be2c28 100644 --- a/src/project/weiyang/AppWorkOrder/AppWorkOrder.vue +++ b/src/project/weiyang/AppWorkOrder/AppWorkOrder.vue @@ -96,7 +96,11 @@ export default { this.eventSourceText = '工单管理' this.$nextTick(() => { this.refresh = true + if (!this.tabIndex) { + uni.$emit('workTaskGetListInit') + } }) + }, confirm(e) { this.eventSource = e[0].value @@ -109,21 +113,15 @@ export default { } }, onShow() { - // document.title = '工单管理' uni.$on('hideTab', () => { this.isTab = false }) uni.$on('showTab', () => { this.isTab = true }) - if (!this.tabIndex) { - // this.$nextTick(() => this.$refs['List'].getListInit()) - uni.$emit('workTaskGetListInit') - } }, onReachBottom() { if (!this.tabIndex) { - // this.$nextTick(() => this.$refs['List'].nextPage()) uni.$emit('workTaskGetNextPage') } }, diff --git a/src/project/weiyang/AppWorkOrder/List.vue b/src/project/weiyang/AppWorkOrder/List.vue index e8082fa..58d8089 100644 --- a/src/project/weiyang/AppWorkOrder/List.vue +++ b/src/project/weiyang/AppWorkOrder/List.vue @@ -94,6 +94,15 @@ export default { return this.$dict.getDict(this.currentTabs == 0 ? 'clapEventStatusAll' : 'clapEventStatusHistory') } }, + created() { + this.searchGrid.girdId = this.user.girdId + this.searchGrid.girdName = this.user.girdName + this.current = 1 + this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory', 'residentEventSource').then(() => { + this.getList() + this.getIsAdd() + }) + }, mounted() { uni.$on('workTaskGetListInit', () => { this.getListInit() @@ -106,15 +115,6 @@ export default { this.getListInit() }) }, - created() { - this.searchGrid.girdId = this.user.girdId - this.searchGrid.girdName = this.user.girdName - this.current = 1 - this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory', 'residentEventSource').then(() => { - this.getList() - this.getIsAdd() - }) - }, methods: { getListInit() { this.current = 1 @@ -139,7 +139,7 @@ export default { eventSource: this.eventSource }, }).then((res) => { - if (res.code == 0 && res.data?.records.length) { + if (res.code == 0) { this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records this.pages = res.data.pages this.$forceUpdate()