Commit d8fce1e294c3b857e19a00524c3ff6d70b105543

Authored by 刘淇
1 parent fa7a1f8d

页面onShow 加载

pages/work/case/distribution.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
4 <view class="ul fs-p20"> 4 <view class="ul fs-p20">
5 <view class="li fs-bg__white fs-p30 fs-size__h4 fs-radius__sm fs-mt20" v-for="(item, index) in dataList"> 5 <view class="li fs-bg__white fs-p30 fs-size__h4 fs-radius__sm fs-mt20" v-for="(item, index) in dataList">
6 <view @click="toDetails(item.problemNo)"> 6 <view @click="toDetails(item.problemNo)">
@@ -61,6 +61,11 @@ export default { @@ -61,6 +61,11 @@ export default {
61 onLoad() { 61 onLoad() {
62 62
63 }, 63 },
  64 + onShow(){
  65 + if (this.$refs.paging) {
  66 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  67 + }
  68 + },
64 methods: { 69 methods: {
65 // 获取记录列表 70 // 获取记录列表
66 queryList(pageNo, pageSize) { 71 queryList(pageNo, pageSize) {
pages/work/case/maintain.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
4 <template #top> 4 <template #top>
5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs> 5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
6 </template> 6 </template>
@@ -75,6 +75,11 @@ export default { @@ -75,6 +75,11 @@ export default {
75 onLoad() { 75 onLoad() {
76 76
77 }, 77 },
  78 + onShow(){
  79 + if (this.$refs.paging) {
  80 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  81 + }
  82 + },
78 methods: { 83 methods: {
79 // 获取记录列表 84 // 获取记录列表
80 queryList(pageNo, pageSize) { 85 queryList(pageNo, pageSize) {
pages/work/case/manage.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
4 <template #top> 4 <template #top>
5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs> 5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
6 </template> 6 </template>
@@ -80,6 +80,11 @@ export default { @@ -80,6 +80,11 @@ export default {
80 onLoad() { 80 onLoad() {
81 81
82 }, 82 },
  83 + onShow(){
  84 + if (this.$refs.paging) {
  85 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  86 + }
  87 + },
83 methods: { 88 methods: {
84 // 获取记录列表 89 // 获取记录列表
85 queryList(pageNo, pageSize) { 90 queryList(pageNo, pageSize) {
pages/work/daily/history.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
4 <template #top> 4 <template #top>
5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs> 5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
6 </template> 6 </template>
@@ -66,6 +66,11 @@ export default { @@ -66,6 +66,11 @@ export default {
66 onLoad() { 66 onLoad() {
67 67
68 }, 68 },
  69 + onShow(){
  70 + if (this.$refs.paging) {
  71 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  72 + }
  73 + },
69 methods: { 74 methods: {
70 // 获取记录列表 75 // 获取记录列表
71 queryList(pageNo, pageSize) { 76 queryList(pageNo, pageSize) {
pages/work/daily/inspection/details.vue
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 <tui-list-cell :hover="false" unlined> 38 <tui-list-cell :hover="false" unlined>
39 <view class="fs-flex__between"><view>完成次数</view><view>{{info.planFinishNum}}</view></view> 39 <view class="fs-flex__between"><view>完成次数</view><view>{{info.planFinishNum}}</view></view>
40 </tui-list-cell> 40 </tui-list-cell>
41 - <view class="fs-mt60 fs-flex__center fs-safe__area"> 41 + <view class="fs-mt60 fs-flex__center fs-safe__area" v-if="!info.planStatus">
42 <tui-button shape="circle" width="500rpx" height="80rpx" shadow @click="toAdd">添加巡检记录</tui-button> 42 <tui-button shape="circle" width="500rpx" height="80rpx" shadow @click="toAdd">添加巡检记录</tui-button>
43 </view> 43 </view>
44 </view> 44 </view>
@@ -49,16 +49,20 @@ import { apiInspectionDetail } from &#39;@/api/work&#39; @@ -49,16 +49,20 @@ import { apiInspectionDetail } from &#39;@/api/work&#39;
49 export default { 49 export default {
50 data() { 50 data() {
51 return { 51 return {
52 - info: {} 52 + info: {},
  53 + planno:''
53 } 54 }
54 }, 55 },
55 onLoad(options) { 56 onLoad(options) {
56 - this.getInspectionInfo(options.planno) 57 + this.planno = options.planno
57 }, 58 },
  59 + onShow(){
  60 + this.getInspectionInfo()
  61 + },
58 methods: { 62 methods: {
59 // 获取巡检详情 63 // 获取巡检详情
60 - getInspectionInfo(planno) {  
61 - apiInspectionDetail({data:{plan_no:planno}}).then(res => { 64 + getInspectionInfo() {
  65 + apiInspectionDetail({data:{plan_no:this.planno}}).then(res => {
62 this.info = res.data 66 this.info = res.data
63 }) 67 })
64 }, 68 },
pages/work/daily/inspection/list.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false" >
4 <template #top> 4 <template #top>
5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs> 5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
6 </template> 6 </template>
@@ -51,6 +51,11 @@ export default { @@ -51,6 +51,11 @@ export default {
51 onLoad() { 51 onLoad() {
52 52
53 }, 53 },
  54 + onShow(){
  55 + if (this.$refs.paging) {
  56 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  57 + }
  58 + },
54 methods: { 59 methods: {
55 // 获取巡检列表 60 // 获取巡检列表
56 queryList(pageNo, pageSize) { 61 queryList(pageNo, pageSize) {
pages/work/daily/maintain/details.vue
@@ -46,16 +46,20 @@ import { apiInspectionDetail } from &#39;@/api/work&#39; @@ -46,16 +46,20 @@ import { apiInspectionDetail } from &#39;@/api/work&#39;
46 export default { 46 export default {
47 data() { 47 data() {
48 return { 48 return {
49 - info: {} 49 + info: {},
  50 + planNo:''
50 } 51 }
51 }, 52 },
52 onLoad(options) { 53 onLoad(options) {
53 - this.getInspectionInfo(options.planNo) 54 + this.planNo = options.planNo
54 }, 55 },
  56 + onShow(){
  57 + this.getInspectionInfo()
  58 + },
55 methods: { 59 methods: {
56 // 获取养护详情 60 // 获取养护详情
57 - getInspectionInfo(planNo) {  
58 - apiInspectionDetail({data:{plan_no:planNo}}).then(res => { 61 + getInspectionInfo() {
  62 + apiInspectionDetail({data:{plan_no: this.planNo}}).then(res => {
59 this.info = res.data 63 this.info = res.data
60 }) 64 })
61 } 65 }
pages/work/daily/maintain/list.vue
1 <template> 1 <template>
2 <view class="container"> 2 <view class="container">
3 - <z-paging ref="paging" v-model="dataList" @query="queryList"> 3 + <z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
4 <template #top> 4 <template #top>
5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs> 5 <tui-tabs :tabs="tabsList" :currentTab="currentTab" :height="90" :padding="10" bold :scale="1.1" @change="change"></tui-tabs>
6 </template> 6 </template>
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <view class="fs-flex1">完成次数:{{item.planFinishNum}}</view> 25 <view class="fs-flex1">完成次数:{{item.planFinishNum}}</view>
26 </view> 26 </view>
27 </view> 27 </view>
28 - <view class="fs-mt20 fs-align__right"> 28 + <view class="fs-mt20 fs-align__right" v-if="!item.planStatus">
29 <tui-tag type="primary" padding="12rpx 30rpx" shape="circle" plain @click="toSubList(item.planNo)">养护记录</tui-tag> 29 <tui-tag type="primary" padding="12rpx 30rpx" shape="circle" plain @click="toSubList(item.planNo)">养护记录</tui-tag>
30 </view> 30 </view>
31 </view> 31 </view>
@@ -49,8 +49,13 @@ export default { @@ -49,8 +49,13 @@ export default {
49 } 49 }
50 }, 50 },
51 onLoad() { 51 onLoad() {
52 - 52 + console.log('12312')
53 }, 53 },
  54 + onShow(){
  55 + if (this.$refs.paging) {
  56 + this.$refs.paging.refresh() // 重置到第一页并触发query事件
  57 + }
  58 + },
54 methods: { 59 methods: {
55 // 获取养护列表 60 // 获取养护列表
56 queryList(pageNo, pageSize) { 61 queryList(pageNo, pageSize) {
pages/work/index.vue
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 <image class="fs-mb10 icon" src="/static/images/work/itmeHome26.png"></image> 15 <image class="fs-mb10 icon" src="/static/images/work/itmeHome26.png"></image>
16 <text>养护计划</text> 16 <text>养护计划</text>
17 </view> 17 </view>
18 - <view class="fs-flex__column fs-items__center item" @click="href('/pages/work/daily/reporting')"> 18 + <view class="fs-flex__column fs-items__center item" v-if="inspectionRoles.includes(userInfo.postId)" @click="href('/pages/work/daily/reporting')">
19 <image class="fs-mb10 icon" src="/static/images/work/itmeHome10.png"></image> 19 <image class="fs-mb10 icon" src="/static/images/work/itmeHome10.png"></image>
20 <text>问题上报</text> 20 <text>问题上报</text>
21 </view> 21 </view>
subPackages/treePage/treeFiles.vue
@@ -5,39 +5,10 @@ @@ -5,39 +5,10 @@
5 <tui-input padding="0" :borderBottom="false" placeholder="请选择归属单位" disabled 5 <tui-input padding="0" :borderBottom="false" placeholder="请选择归属单位" disabled
6 backgroundColor="transparent" v-model="formData.companyId"></tui-input> 6 backgroundColor="transparent" v-model="formData.companyId"></tui-input>
7 </tui-form-item> 7 </tui-form-item>
8 -<!-- <tui-form-item prop="roadName" :bottom-border="false" label="道路名称">-->  
9 -<!--&lt;!&ndash; <tui-input padding="0" :borderBottom="false" placeholder="请输入道路" maxlength="20" :clearable="true" :backgroundColor="#f5f5f5" :inputBorder="true" :radius="30"&ndash;&gt;-->  
10 -<!--&lt;!&ndash; v-model="formData.roadName" @confirm="searchChange" :left-icon="Search" >&ndash;&gt;-->  
11 -<!--&lt;!&ndash; <slot :name="left">123</slot>&ndash;&gt;-->  
12 -<!--&lt;!&ndash; </tui-input>&ndash;&gt;-->  
13 -  
14 -<!-- <tui-input padding="0" :borderBottom="false" placeholder="请输入道路" maxlength="20" @confirm="searchChange"-->  
15 -<!-- v-model="formData.roadName">-->  
16 -<!--&lt;!&ndash; <template v-slot:left>&ndash;&gt;-->  
17 -<!--&lt;!&ndash; <tui-icon name="search" :size="15" ></tui-icon>&ndash;&gt;-->  
18 -<!--&lt;!&ndash; </template>&ndash;&gt;-->  
19 -<!-- </tui-input>-->  
20 -<!-- <template v-slot:right>-->  
21 -<!-- <tui-icon name="search" :size="20" @click="searchChange"></tui-icon>-->  
22 -<!--&lt;!&ndash; <tui-form-button width="188rpx" height="64rpx" background="#f2f2f2" color="#5677fc" size="24"&ndash;&gt;-->  
23 -<!--&lt;!&ndash; bold radius="12rpx">获取验证码</tui-form-button>&ndash;&gt;-->  
24 -<!-- </template>-->  
25 -  
26 -<!-- </tui-form-item>-->  
27 -  
28 -  
29 </tui-form> 8 </tui-form>
30 9
31 <tui-searchbar radius="40rpx" height="64rpx" placeholder="请输入道路名称" @search="getSeach" @clear="setSeach"></tui-searchbar> 10 <tui-searchbar radius="40rpx" height="64rpx" placeholder="请输入道路名称" @search="getSeach" @clear="setSeach"></tui-searchbar>
32 11
33 - <!-- <tui-row marginTop="10px" :gutter="5" class="full-height-row">-->  
34 - <!-- <tui-col :span="8" class="left-con full-height-col" >-->  
35 - <!-- <view class="full-height-col left-con">1</view>-->  
36 - <!-- </tui-col>-->  
37 - <!-- <tui-col :span="16" class="right-con full-height-col" >-->  
38 - <!-- <view class="full-height-col">2</view>-->  
39 - <!-- </tui-col>-->  
40 - <!-- </tui-row>-->  
41 12
42 <view class="full-height-row"> 13 <view class="full-height-row">
43 <view class="full-height-col left-con"> 14 <view class="full-height-col left-con">
@@ -133,10 +104,6 @@ export default { @@ -133,10 +104,6 @@ export default {
133 console.log(treeCount) 104 console.log(treeCount)
134 uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${roadId}&count=${treeCount}`) 105 uni.$tui.href(`/subPackages/treePage/treeRecord?roadId=${roadId}&count=${treeCount}`)
135 }, 106 },
136 - // 搜索  
137 - searchChange() {  
138 - this.deptListQuery()  
139 - },  
140 // 归属班组 107 // 归属班组
141 deptListQuery() { 108 deptListQuery() {
142 deptListReq({data: {companyId: this.companyId, roadName: this.formData.roadName}}).then(res => { 109 deptListReq({data: {companyId: this.companyId, roadName: this.formData.roadName}}).then(res => {
@@ -164,7 +131,6 @@ export default { @@ -164,7 +131,6 @@ export default {
164 this.show = false 131 this.show = false
165 }, 132 },
166 pickerChange(e) { 133 pickerChange(e) {
167 -  
168 this.formData.companyId = e.dictLabel 134 this.formData.companyId = e.dictLabel
169 this.companyId = e.dictValue 135 this.companyId = e.dictValue
170 console.log(this.companyId) 136 console.log(this.companyId)