2021-12-14 18:36:19 +08:00
|
|
|
|
<template>
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<ai-card title="走访记录" class="visit" v-loading="loading">
|
2021-12-14 18:36:19 +08:00
|
|
|
|
<el-button slot="right" icon="iconfont iconAdd" type="text" @click="isShow = true">添加走访记录</el-button>
|
|
|
|
|
|
<template #content>
|
|
|
|
|
|
<div class="visit-list">
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<div class="visit-item" v-for="(item, index) in list" :key="index">
|
2021-12-14 18:36:19 +08:00
|
|
|
|
<div class="visit-item__top">
|
|
|
|
|
|
<div class="left">
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<div class="avatar">{{ item.name.substr(item.name.length - 2) }}</div>
|
|
|
|
|
|
<h2>{{ item.name }}</h2>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</div>
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<span>{{ item.visitTime }}</span>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</div>
|
2021-12-31 15:44:18 +08:00
|
|
|
|
<b>{{ item.title }}</b>
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<p>{{ item.description }}</p>
|
2022-03-18 09:10:10 +08:00
|
|
|
|
<div class="visit-imgs" v-if="item.images.length">
|
2021-12-31 15:44:18 +08:00
|
|
|
|
<ai-uploader v-model="item.images" :instance="instance" :limit="9" disabled/>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<div class="visit-status">
|
|
|
|
|
|
<span>现实状态:</span>
|
2021-12-24 09:19:43 +08:00
|
|
|
|
<i>{{ dict.getLabel('visitCondolenceReality', item.reality) }}</i>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2021-12-30 09:27:06 +08:00
|
|
|
|
<ai-empty v-if="!list.length"></ai-empty>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<ai-dialog
|
2021-12-31 11:29:18 +08:00
|
|
|
|
:visible.sync="isShow"
|
|
|
|
|
|
width="1000px"
|
|
|
|
|
|
height="500px"
|
|
|
|
|
|
title="添加走访记录"
|
|
|
|
|
|
@close="onClose"
|
|
|
|
|
|
@onConfirm="onConfirm">
|
|
|
|
|
|
<el-form ref="form" :model="form" label-width="110px" label-position="right" size="small">
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<ai-bar title="走访记录"></ai-bar>
|
|
|
|
|
|
<div class="ai-form" :model="form" label-width="110px" label-position="right">
|
2021-12-31 11:29:18 +08:00
|
|
|
|
<el-form-item label="走访时间" prop="visitTime"
|
|
|
|
|
|
:rules="[{ required: true, message: '请选择走访时间', trigger: 'change' }]">
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<el-date-picker
|
2021-12-31 11:29:18 +08:00
|
|
|
|
v-model="form.visitTime"
|
2021-12-31 11:32:40 +08:00
|
|
|
|
type="datetime"
|
2021-12-31 11:29:18 +08:00
|
|
|
|
style="width: 100%;"
|
2021-12-31 11:32:40 +08:00
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
2021-12-31 11:29:18 +08:00
|
|
|
|
placeholder="请选择走访时间">
|
2021-12-15 15:13:22 +08:00
|
|
|
|
</el-date-picker>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
2021-12-31 11:29:18 +08:00
|
|
|
|
<el-form-item label="现实状态" prop="reality"
|
|
|
|
|
|
:rules="[{ required: true, message: '请选择现实状态', trigger: 'change' }]">
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<ai-select
|
2021-12-31 11:29:18 +08:00
|
|
|
|
v-model="form.reality"
|
|
|
|
|
|
:selectList="dict.getDict('visitCondolenceReality')"
|
|
|
|
|
|
laceholder="请选择现实状态">
|
2021-12-15 15:13:22 +08:00
|
|
|
|
</ai-select>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
2021-12-31 14:54:10 +08:00
|
|
|
|
<el-form-item label="入户走访事项" prop="title" style="width: 100%;"
|
|
|
|
|
|
:rules="[{ required: true, message: '请输入 入户走访事项'}]">
|
2021-12-31 11:29:18 +08:00
|
|
|
|
<el-input placeholder="请输入 入户走访事项" v-model="form.title" maxlength="30" show-word-limit/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="入户走访内容" prop="description" style="width: 100%;">
|
|
|
|
|
|
<el-input type="textarea" placeholder="请输入 入户走访内容" v-model="form.description" :rows="4" maxlength="500"
|
|
|
|
|
|
show-word-limit/>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<el-form-item label="图片" prop="images" style="width: 100%;">
|
2021-12-31 11:29:18 +08:00
|
|
|
|
<ai-uploader v-model="form.images" :instance="instance" :limit="9" isShowTip/>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</ai-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</ai-card>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-12-31 11:29:18 +08:00
|
|
|
|
import {mapState} from 'vuex'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'visit',
|
|
|
|
|
|
|
2022-01-14 10:18:58 +08:00
|
|
|
|
props: ['id', 'dict', 'instance', 'appId', 'name', 'areaId'],
|
2021-12-31 11:29:18 +08:00
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
appList: [],
|
|
|
|
|
|
list: [],
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
isShow: false,
|
|
|
|
|
|
form: {
|
|
|
|
|
|
visitTime: '',
|
|
|
|
|
|
reality: '',
|
|
|
|
|
|
images: [],
|
|
|
|
|
|
description: ''
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
2021-12-31 11:29:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['user'])
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
this.dict.load('visitCondolenceReality').then(() => {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
this.loading = true
|
|
|
|
|
|
this.instance.post(`/app/appvisitvondolence/list?optionId=${this.id}&size=10000`).then(res => {
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
this.list = res.data.records.map(item => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
...item,
|
|
|
|
|
|
images: item.images ? JSON.parse(item.images) : []
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2021-12-15 15:13:22 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
this.loading = false
|
2021-12-15 15:13:22 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
onConfirm() {
|
|
|
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
this.instance.post(`/app/appvisitvondolence/addOrUpdate`, {
|
|
|
|
|
|
...this.form,
|
|
|
|
|
|
optionId: this.id,
|
|
|
|
|
|
images: JSON.stringify(this.form.images),
|
|
|
|
|
|
applicationId: this.appId,
|
|
|
|
|
|
name: this.name,
|
2022-01-14 10:18:58 +08:00
|
|
|
|
areaId: this.areaId
|
2021-12-31 11:29:18 +08:00
|
|
|
|
}).then(res => {
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
this.$message.success('添加成功')
|
|
|
|
|
|
this.isShow = false
|
|
|
|
|
|
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
onClose() {
|
2021-12-31 11:30:49 +08:00
|
|
|
|
this.form = {}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-31 11:29:18 +08:00
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-12-31 11:29:18 +08:00
|
|
|
|
.visit {
|
|
|
|
|
|
.visit-list {
|
|
|
|
|
|
.visit-item {
|
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
&:last-child {
|
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
.visit-status {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
font-size: 14px;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
span {
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
i {
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
font-style: normal;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
2021-12-31 11:29:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
& > p {
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
text-align: justify;
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-18 09:10:10 +08:00
|
|
|
|
b {
|
|
|
|
|
|
display: block;
|
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
.visit-item__top {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
margin-bottom: 10px;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
span {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #999;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
.left {
|
2021-12-14 18:36:19 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
img, .avatar {
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
border-radius: 50%;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
font-size: 14px;
|
2021-12-31 11:29:18 +08:00
|
|
|
|
color: #fff;
|
|
|
|
|
|
background: #26f;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-31 11:29:18 +08:00
|
|
|
|
h2 {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 500;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-31 11:29:18 +08:00
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</style>
|