调查走访

This commit is contained in:
liuye
2022-11-22 14:21:40 +08:00
parent eb868b1996
commit 69ba2ed10e
3 changed files with 18 additions and 34 deletions

View File

@@ -122,7 +122,7 @@ export default {
},
getList() {
this.$http
.post('/app/appvisitvondolence/list', null, {
.post('/app/appvisitvondolencepingchang/list', null, {
params: {
size: 10,
current: this.current,
@@ -181,7 +181,7 @@ export default {
},
delet() {
this.$http.post(`/app/appvisitvondolence/delete?ids=${this.deletId}`).then((res) => {
this.$http.post(`/app/appvisitvondolencepingchang/delete?ids=${this.deletId}`).then((res) => {
if (res.code == 0) {
this.$u.toast('删除成功!')
this.getListInit()

View File

@@ -20,7 +20,7 @@
</u-form-item>
<div class="line"></div>
<u-form-item label="区域定位" prop="address" required :right-icon="id ? '' : 'arrow-right'" class="realitys">
<u-form-item label="区域定位" prop="address" :right-icon="id ? '' : 'arrow-right'" class="realitys">
<u-input v-model="forms.address" disabled placeholder="请点击" @click="chooseAddress" />
</u-form-item>
@@ -57,8 +57,8 @@
<div class="line"></div>
<u-form-item label="图片(最多9张)" prop="images" class="avatars" label-position="top" :border-bottom="false">
<AiUploader :def.sync="forms.images" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
<u-form-item label="图片(最多9张)" prop="files" class="avatars" label-position="top" :border-bottom="false">
<AiUploader :def.sync="forms.files" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"></AiUploader>
</u-form-item>
</u-form>
</div>
@@ -84,6 +84,7 @@ export default {
optionId: '',
name: '',
phone: '',
residentId: '',
address: '',
lng: '',
@@ -94,7 +95,7 @@ export default {
applicationId: '',
title: '',
description: '',
images: [],
files: [],
},
showAreaId: false,
showStstus: false,
@@ -164,7 +165,7 @@ export default {
getDetail() {
if (this.id) {
this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
this.$http.post(`/app/appvisitvondolencepingchang/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.forms = res.data
this.forms.create_user_name = res.data.name
@@ -172,9 +173,6 @@ export default {
this.forms.areaId = res.data.areaId
this.forms.areaName = res.data.areaName
this.forms.reality = this.$dict.getLabel('realityStatus', res.data.reality)
if (res.data.images) {
this.forms.images = JSON.parse(res.data.images || '[]')
}
}
})
}
@@ -198,30 +196,16 @@ export default {
return this.$u.toast('请输入入户走访事项')
}
const imgs = []
if (this.forms.images) {
this.forms.images.map((e) => {
imgs.push({ url: e.url, id: e.id })
})
}
this.flag = true
this.$http
.post(`/app/appvisitvondolence/addOrUpdate`, {
areaId: this.forms.areaId,
applicationId: this.forms.applicationId,
name: this.forms.name,
visitTime: this.forms.visitTime,
residentId: this.forms.residentId,
.post(`/app/appvisitvondolencepingchang/addOrUpdate`, {
...this.forms,
// menuLevel3Name: this.forms.menuLevel3Name,
applicationId: this.forms.applicationId,
reality: this.forms.realityValue ? this.forms.realityValue : this.forms.reality,
title: this.forms.title,
description: this.forms.description,
createUserId: this.user.id,
createUserName: this.user.name,
images: JSON.stringify(imgs) || [],
id: this.id,
})
.then((res) => {

View File

@@ -24,7 +24,7 @@
<div class="walk-item">
<span>走访人员</span>
<span><AiOpenData v-if="data.createUserName" type="userName" :openid="data.createUserName" style="display: inline-block" /></span>
<span>{{data.createUserName}}</span>
</div>
<div class="walk-item">
@@ -37,7 +37,7 @@
<div class="hint-con" v-if="data.description">{{ data.description }}</div>
<div class="imgs">
<img :src="item.url" alt="" v-for="(item, index) in data.images" :key="index" @click.stop="previewImage(data.images, item.url)" />
<img :src="item.url" alt="" v-for="(item, index) in data.files" :key="index" @click.stop="previewImage(data.files, item.url)" />
</div>
</div>
</div>
@@ -69,20 +69,20 @@ export default {
mounted() {},
methods: {
getDetail() {
this.$http.post(`/app/appvisitvondolence/queryDetailById?id=${this.id}`).then((res) => {
this.$http.post(`/app/appvisitvondolencepingchang/queryDetailById?id=${this.id}`).then((res) => {
if (res?.data) {
this.data = res.data
if (this.data.images) {
this.data.images = JSON.parse(this.data.images || '[]')
if (this.data.files) {
this.data.files = JSON.parse(this.data.files || '[]')
this.data.labelList = this.data.labels.split(',') || []
}
}
})
},
previewImage(images, img) {
previewImage(files, img) {
uni.previewImage({
urls: images.map((v) => v.url),
urls: files.map((v) => v.url),
current: img,
})
},