Blame view

pages/work/daily/inspection/record.vue 1.63 KB
46b6767c   刘淇   init 提交到库
1
2
  <template>
  	<view class="container">
20f33942   刘淇   反正多次提交
3
  		<z-paging ref="paging" v-model="dataList" @query="queryList" :auto="false">
46b6767c   刘淇   init 提交到库
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  		<view class="ul fs-p20">
  			<view class="li fs-bg__white fs-p30 fs-size__h4 fs-radius__sm fs-mt20" v-for="(item, index) in dataList">
  				<view class="fs-color__subtitle">{{item.remark}}</view>
  				<view v-if="item.imgList.length" class="fs-flex fs-mt20">
  					<view class="fs-mr30" v-for="(value, key) in item.imgList">
  						<tui-lazyload-img radius="12rpx" width="200rpx" height="200rpx" mode="aspectFill" :src="value" @click="previewImage(index,key)"></tui-lazyload-img>
  					</view>
  				</view>
  				<view class="fs-mt20 fs-align__right fs-color__label">{{item.createTime}}</view>
  			</view>
  		</view>
  		</z-paging>
  	</view>
  </template>
  
  <script>
  import { apiInspectionRecord } from '@/api/work'
  export default {
  	data() {
  		return {
  			planNo: '',
  			dataList: []
  		}
  	},
  	onLoad(options) {
  		this.planNo = options.planno
  	},
20f33942   刘淇   反正多次提交
31
32
33
34
35
    onShow(){
      if (this.$refs.paging) {
        this.$refs.paging.refresh() // 重置到第一页并触发query事件
      }
    },
46b6767c   刘淇   init 提交到库
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
  	methods: {
  		// 获取巡检记录
  		queryList(pageNo, pageSize) {
  			const params = {
  				pageReq: {isAsc: 'desc', orderByColumn: 'id', pageNum: pageNo, pageSize: pageSize},
  				planNo: this.planNo
  			}
  			apiInspectionRecord({data:params}).then(res => {
  				this.$refs.paging.complete(res.rows)
  			})
  		},
  		// 图片预览
  		previewImage(index, key) {
  			const imageList = this.dataList[index].imgList
  			uni.previewImage({
  				current: imageList[key],
  				loop: true,
  				urls: imageList
  			})
  		}
  	}
  }
  </script>
  
  <style lang="scss" scoped>
  .ul .li:first-child {
  	margin-top: 0;
  }
  </style>