2021-12-14 18:36:19 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<ai-card title="走访记录" class="visit">
|
|
|
|
|
|
<el-button slot="right" icon="iconfont iconAdd" type="text" @click="isShow = true">添加走访记录</el-button>
|
|
|
|
|
|
<template #content>
|
|
|
|
|
|
<div class="visit-list">
|
|
|
|
|
|
<div class="visit-item" v-for="(item, index) in 10" :key="index">
|
|
|
|
|
|
<div class="visit-item__top">
|
|
|
|
|
|
<div class="left">
|
|
|
|
|
|
<img src="https://p26-passport.byteacctimg.com/img/user-avatar/6401428bcd3b2b9bfed4f31cca07b798~300x300.image">
|
|
|
|
|
|
<h2>且听风吟</h2>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<span>2020-07-05 12:02:33</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<p>且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟且听风吟</p>
|
|
|
|
|
|
<div class="visit-imgs">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="visit-status">
|
|
|
|
|
|
<span>现实状态:</span>
|
|
|
|
|
|
<i>失联</i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<ai-dialog
|
|
|
|
|
|
:visible.sync="isShow"
|
|
|
|
|
|
width="1000px"
|
|
|
|
|
|
height="500px"
|
2021-12-15 15:13:22 +08:00
|
|
|
|
title="添加走访记录"
|
2021-12-14 18:36:19 +08:00
|
|
|
|
@close="onClose"
|
|
|
|
|
|
@onConfirm="onConfirm">
|
|
|
|
|
|
<el-form ref="form" :model="form" label-width="110px" label-position="right">
|
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">
|
|
|
|
|
|
<el-form-item label="走访时间" prop="visitTime" :rules="[{ required: true, message: '请选择走访时间', trigger: 'change' }]">
|
|
|
|
|
|
<el-date-picker
|
|
|
|
|
|
v-model="form.visitTime"
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
placeholder="请选择走访时间">
|
|
|
|
|
|
</el-date-picker>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<el-form-item label="现实状态" prop="reality" :rules="[{ required: true, message: '请选择现实状态', trigger: 'change' }]">
|
|
|
|
|
|
<ai-select
|
|
|
|
|
|
v-model="form.reality"
|
|
|
|
|
|
:selectList="dict.getDict('visitCondolenceReality')"
|
|
|
|
|
|
laceholder="请选择现实状态">
|
|
|
|
|
|
</ai-select>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
2021-12-15 15:13:22 +08:00
|
|
|
|
<el-form-item label="描述" prop="description" style="width: 100%;">
|
|
|
|
|
|
<el-input type="textarea" placeholder="请输入描述" v-model="form.description" :rows="4"></el-input>
|
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%;">
|
|
|
|
|
|
<ai-uploader v-model="form.images" :instance="instance" :limit="9"></ai-uploader>
|
2021-12-14 18:36:19 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
</ai-dialog>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</ai-card>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-12-15 15:13:22 +08:00
|
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
|
|
2021-12-14 18:36:19 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'visit',
|
|
|
|
|
|
|
2021-12-15 15:13:22 +08:00
|
|
|
|
props: ['id', 'dict', 'instance', 'appId', 'name'],
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
appList: [],
|
2021-12-15 15:13:22 +08:00
|
|
|
|
list: [],
|
2021-12-14 18:36:19 +08:00
|
|
|
|
isShow: false,
|
|
|
|
|
|
form: {
|
2021-12-15 15:13:22 +08:00
|
|
|
|
visitTime: '',
|
|
|
|
|
|
reality: '',
|
|
|
|
|
|
images: [],
|
|
|
|
|
|
description: ''
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-12-15 15:13:22 +08:00
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
...mapState(['user'])
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
this.dict.load('visitCondolenceReality', () => {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
|
|
|
|
|
methods: {
|
2021-12-15 15:13:22 +08:00
|
|
|
|
getList () {
|
|
|
|
|
|
this.instance.post(`/app/appvisitvondolence/list?id=${this.id}&size=10000`).then(res => {
|
|
|
|
|
|
if (res.code === 0) {
|
|
|
|
|
|
this.list = res.data.records
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2021-12-14 18:36:19 +08:00
|
|
|
|
onConfirm () {
|
|
|
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2021-12-15 15:13:22 +08:00
|
|
|
|
this.instance.post(`/app/appdiylargescreen/addOrUpdateDatasource`, {
|
2021-12-14 18:36:19 +08:00
|
|
|
|
...this.form,
|
2021-12-15 15:13:22 +08:00
|
|
|
|
optionId: this.id,
|
|
|
|
|
|
images: JSON.stringify(this.form.images),
|
|
|
|
|
|
applicationId: this.appId,
|
|
|
|
|
|
name: this.name,
|
|
|
|
|
|
visitTime: this.form.visitTime + ' 23:59:59'
|
2021-12-14 18:36:19 +08:00
|
|
|
|
}).then(res => {
|
|
|
|
|
|
if (res.code === 0) {
|
2021-12-15 15:13:22 +08:00
|
|
|
|
this.$message.success('添加成功')
|
2021-12-14 18:36:19 +08:00
|
|
|
|
this.isShow = false
|
|
|
|
|
|
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
onClose () {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.visit {
|
|
|
|
|
|
.visit-list {
|
|
|
|
|
|
.visit-item {
|
|
|
|
|
|
padding: 10px 0;
|
|
|
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
|
|
|
|
|
|
|
|
&:first-child {
|
|
|
|
|
|
padding-top: 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.visit-status {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
|
color: #333;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
i {
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
font-style: normal;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
& > p {
|
|
|
|
|
|
line-height: 1.4;
|
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
|
text-align: justify;
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.visit-item__top {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
color: #999;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|