46b6767c
刘淇
init 提交到库
|
1
2
|
<template>
<view class="container">
|
b56bb97b
刘淇
首次加载
|
3
|
<tui-list-cell :hover="false" v-for="(item, index) in dataList" :auto="false">
|
46b6767c
刘淇
init 提交到库
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<view class="fs-flex__between">
<view>{{item.planNo}}({{item.currentPlanNum}})</view>
<view>完成比例 <tui-text :text="item.totalFinishPercent" type="danger"></tui-text>%</view>
</view>
<view class="fs-mt20 fs-align__right">
<tui-tag v-if="item.totalFinishPercent < 100" type="primary" padding="12rpx 30rpx" shape="circle" plain @click="toAdd(item.planNo, item.currentPlanNum, item.totalFinishPercent)">添加记录</tui-tag>
<tui-tag type="primary" padding="12rpx 30rpx" margin="0 0 0 20rpx" shape="circle" plain @click="toRecord(item.planNo, item.currentPlanNum)">提交记录</tui-tag>
</view>
</tui-list-cell>
</view>
</template>
<script>
import { apiMaintainSubList, apiInspectionDetail } from '@/api/work'
export default {
data() {
return {
info: {},
|
6eea308a
刘淇
页面onShow 加载
|
22
23
24
|
dataList: [],
planNo:'',
|
46b6767c
刘淇
init 提交到库
|
25
26
27
|
}
},
onLoad(options) {
|
6eea308a
刘淇
页面onShow 加载
|
28
29
|
this.planNo = options.planNo
|
46b6767c
刘淇
init 提交到库
|
30
|
},
|
6eea308a
刘淇
页面onShow 加载
|
31
32
33
34
|
onShow(){
this.getList()
this.getInspectionInfo()
},
|
46b6767c
刘淇
init 提交到库
|
35
36
|
methods: {
// 获取次数列表
|
6eea308a
刘淇
页面onShow 加载
|
37
38
|
getList() {
apiMaintainSubList({data:{plan_no:this.planNo}}).then(res => {
|
46b6767c
刘淇
init 提交到库
|
39
40
41
42
|
this.dataList = res.data
})
},
// 获取养护详情
|
6eea308a
刘淇
页面onShow 加载
|
43
44
|
getInspectionInfo() {
apiInspectionDetail({data:{plan_no:this.planNo}}).then(res => {
|
46b6767c
刘淇
init 提交到库
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
this.info = res.data
})
},
// 跳转记录添加
toAdd(planNo, currentPlanNum, totalFinishPercent) {
let path = 'water'
// switch (this.info.maintainTypeId) {
// case 2:
// path = 'water'
// break
// case 3:
// path = 'trim'
// break
// case 4:
// path = 'prevention'
// break
// case 5:
// path = 'weed'
// break
// case 10:
// path = 'manure'
// break
// }
uni.$tui.href(`/pages/work/daily/maintain/${path}?plan_no=${planNo}¤t_plan_num=${currentPlanNum}&total_finish_percent=${totalFinishPercent}`)
},
// 跳转记录
toRecord(planNo, currentPlanNum) {
uni.$tui.href(`/pages/work/daily/maintain/record?plan_no=${planNo}&maintainTypeId=${this.info.maintainTypeId}¤t_plan_num=${currentPlanNum}`)
}
}
}
</script>
<style lang="scss" scoped>
</style>
|