调查走访

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() { getList() {
this.$http this.$http
.post('/app/appvisitvondolence/list', null, { .post('/app/appvisitvondolencepingchang/list', null, {
params: { params: {
size: 10, size: 10,
current: this.current, current: this.current,
@@ -181,7 +181,7 @@ export default {
}, },
delet() { 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) { if (res.code == 0) {
this.$u.toast('删除成功!') this.$u.toast('删除成功!')
this.getListInit() this.getListInit()

View File

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

View File

@@ -24,7 +24,7 @@
<div class="walk-item"> <div class="walk-item">
<span>走访人员</span> <span>走访人员</span>
<span><AiOpenData v-if="data.createUserName" type="userName" :openid="data.createUserName" style="display: inline-block" /></span> <span>{{data.createUserName}}</span>
</div> </div>
<div class="walk-item"> <div class="walk-item">
@@ -37,7 +37,7 @@
<div class="hint-con" v-if="data.description">{{ data.description }}</div> <div class="hint-con" v-if="data.description">{{ data.description }}</div>
<div class="imgs"> <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> </div>
</div> </div>
@@ -69,20 +69,20 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
getDetail() { 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) { if (res?.data) {
this.data = res.data this.data = res.data
if (this.data.images) { if (this.data.files) {
this.data.images = JSON.parse(this.data.images || '[]') this.data.files = JSON.parse(this.data.files || '[]')
this.data.labelList = this.data.labels.split(',') || [] this.data.labelList = this.data.labels.split(',') || []
} }
} }
}) })
}, },
previewImage(images, img) { previewImage(files, img) {
uni.previewImage({ uni.previewImage({
urls: images.map((v) => v.url), urls: files.map((v) => v.url),
current: img, current: img,
}) })
}, },