linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
1
2
3
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
31
32
33
34
35
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
    <view class="">
        <view class="item-row flex j-c-s-b a-i-c">
            <text>走访类型</text>
            <text>{{typeName}}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c" v-if="info.type == 2">
            <text>重点人群类型</text>
            <text>{{labelName}}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c">
            <text>被访人姓名</text>
            <text>{{houseHold.name}}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c">
            <text>手机号</text>
            <text>{{houseHold.phoneNumber}}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c">
            <text>走访地址</text>
            <text class="item-content">{{houseHold.currentAddress}}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c">
            <text>内容</text>
            <text class="item-content">{{info.context || ""  }}</text>
        </view>
        <view class="item-row flex j-c-s-b a-i-c">
            <text>走访时间</text>
            <text>{{info.workTime || ""}}</text>
        </view>
 
        <view class="image-wrap bgc-ff" v-if="Image.length">
            <view class="mb-20">
                走访图片
            </view>
            <view class="image-item" v-for="(i,k) in images" @click="previewImage(i)">
                <u-image :src="i" width="100rpx" height="100rpx"></u-image>
            </view>
 
        </view>
 
    </view>
</template>
 
<script>
    import {
        getWorkLogDetail
    } from "@/api/workLog/workLog.js"
    import {
        getHouseholdDetail
    } from '@/api/house/household.js'
    import {
        bizDictionary,
        update
    } from '@/api/system/dict.js'
    import {
        getLabelListByParentId
    } from "@/api/label/label.js";
    export default {
        data() {
            return {
                info: {},
                images: [],
                typeName: "",
                labelName: "",
                houseHold: {},
                typeList: [],
                labelList: []
            }
        },
        async onLoad(option) {
            await this.getTypeList();
            await this.getLabelList();
            setTimeout(() => {
                this.getDetail(option.id);
            }, 200)
 
        },
        methods: {
            getDetail(id) {
                getWorkLogDetail({
                    id
                }).then(res => {
                    this.info = res.data;
                    this.images = this.$setImageUrl(res.data.url);
                    this.getHousehold(res.data.householdId);
                    this.typeName = this.$getIndex(this.typeList, res.data.type, "dictKey", "dictValue").name;
                    this.labelName = this.$getIndex(this.labelList, res.data.personType, "id", "name").name;
                })
            },
 
 
            getTypeList() {
                bizDictionary({
                    code: "haveType"
                }).then(res => {
                    console.log(res)
                    this.typeList = res.data;
                })
            },
 
            getLabelList() {
                getLabelListByParentId({
                    parentId: 100
                }).then(res => {
                    console.log(res);
                    this.labelList = res.data;
                })
            },
 
            getTypeValue(value) {
                for (let i = 0, ii = this.typeList.length; i < ii; i++) {
                    if (value == this.typeList[i].dictKey) {
                        return this.typeList[i].dictValue
                    }
                }
            },
 
            getLabelValue(value) {
 
                for (let i = 0, ii = this.labelList.length; i < ii; i++) {
                    if (value == this.labelList[i].id) {
                        return this.labelList[i].name
                    }
                }
            },
 
            getHousehold(id) {
                getHouseholdDetail({
                    id
                }).then(res => {
                    console.log(res);
                    this.houseHold = res.data;
                })
            },
 
            previewImage(cur) {
                uni.previewImage({
                    urls: this.images,
                    current: cur
                })
            }
 
        }
    }
</script>
 
<style lang="scss">
    page {
        background-color: #f5f5f5;
    }
 
    .item-row {
        width: 100%;
        padding: 30rpx;
        box-sizing: border-box;
        border-bottom: 1px solid #f5f5f5;
        font-size: 28rpx;
        background-color: #fff;
 
        .item-content {
            width: 70%;
            text-align: right;
        }
    }
 
    .image-wrap {
        margin-top: 20rpx;
        padding: 20rpx;
 
        .image-item {
            margin-right: 20rpx;
        }
    }
</style>