<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>
|