BUG 28292
This commit is contained in:
@@ -227,7 +227,7 @@ export default {
|
||||
})
|
||||
},
|
||||
showDetail(e) {
|
||||
uni.navigateTo({url: `/apps/AppPeopleList/DetailCard?id=${e.id}`})
|
||||
uni.navigateTo({url: `/apps/AppPeopleList/DetailCard?id=${e.resident_id}`})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
<span class="label"><span class="tips">{{ item.mustFill == 1 ? '*' : '' }}</span>{{ item.fieldName }}</span>
|
||||
<div class="value" v-if="item.dict"
|
||||
v-text="toString($dict.getLabel(item.dict, formData[item.fieldDbName]))"/>
|
||||
<div class="value" v-else-if="item.type=='area'" v-text="toString(formData[item.fieldDbName+'_name'])"/>
|
||||
<div class="value" v-else-if="item.type=='area'">
|
||||
<AiAreaPicker :value="formData[item.fieldDbName]" isForm disabled/>
|
||||
</div>
|
||||
<div class="value" v-else-if="item.type=='upload'">
|
||||
<template v-if="formData[item.fieldDbName]">
|
||||
<ai-image v-for="(op,i) in [formData[item.fieldDbName]].flat()" :key="i" :src="op" preview/>
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
<div class="header-description">
|
||||
<u-form :model="forms" ref="uForm" label-width="auto">
|
||||
<u-form-item label="区域选择" prop="areaId" class="areaIds" style="position: relative">
|
||||
<AiAreaPicker :value="forms.areaId" :areaId="areaIdProps" @select="areaSelect" style="color: #333"></AiAreaPicker>
|
||||
<u-icon name="arrow-right" color="rgb(192, 196, 204)" size="30" style="margin-left: 4px" />
|
||||
<AiAreaPicker :value="forms.areaId" :areaId="areaIdProps" @select="areaSelect" isForm/>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="走访对象" prop="name" required :right-icon="id ? '' : 'arrow-right'" class="create_user_names">
|
||||
<u-input v-model="forms.name" disabled placeholder="请选择走访对象" @click="toWalkObject" />
|
||||
<u-form-item label="走访对象" prop="name" required :right-icon="id ? '' : 'arrow-right'"
|
||||
class="create_user_names">
|
||||
<u-input v-model="forms.name" disabled placeholder="请选择走访对象" @click="toWalkObject"/>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="走访时间" prop="visitTime" required :right-icon="id ? '' : 'arrow-right'" class="realitys">
|
||||
<u-input v-model="forms.visitTime" disabled placeholder="请选择走访时间" @click="showVisitTime = true" />
|
||||
<u-input v-model="forms.visitTime" disabled placeholder="请选择走访时间" @click="showVisitTime = true"/>
|
||||
|
||||
<u-picker v-model="showVisitTime" :params="params" mode="time" @confirm="change"></u-picker>
|
||||
</u-form-item>
|
||||
@@ -25,29 +25,33 @@
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="现实状态" prop="reality" :right-icon="id ? '' : 'arrow-right'" class="realitys">
|
||||
<u-input v-model="forms.reality" disabled placeholder="请选择现实状态" @click="realityClick" />
|
||||
<u-input v-model="forms.reality" disabled placeholder="请选择现实状态" @click="realityClick"/>
|
||||
|
||||
<u-select v-model="showStstus" :list="$dict.getDict('realityStatus')" value-name="dictValue" label-name="dictName" @confirm="realityStstus"></u-select>
|
||||
<u-select v-model="showStstus" :list="$dict.getDict('realityStatus')" value-name="dictValue"
|
||||
label-name="dictName" @confirm="realityStstus"></u-select>
|
||||
</u-form-item>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="入户走访事项" prop="title" required label-position="top" :border-bottom="false">
|
||||
<u-input v-model="forms.title" placeholder="请输入入户走访事项(30字以内)" type="textarea" auto-height height="60" :maxlength="30" />
|
||||
<u-input v-model="forms.title" placeholder="请输入入户走访事项(30字以内)" type="textarea" auto-height height="60"
|
||||
:maxlength="30"/>
|
||||
</u-form-item>
|
||||
<div class="hint">{{ forms.title.length }}/30</div>
|
||||
|
||||
<div class="line"></div>
|
||||
|
||||
<u-form-item label="入户走访内容" prop="description" label-position="top" :border-bottom="false">
|
||||
<u-input v-model="forms.description" placeholder="请输入入户走访事项(500字以内)" type="textarea" auto-height height="60" :maxlength="500" />
|
||||
<u-input v-model="forms.description" placeholder="请输入入户走访事项(500字以内)" type="textarea" auto-height height="60"
|
||||
:maxlength="500"/>
|
||||
</u-form-item>
|
||||
<div class="hint">{{ forms.description.length }}/500</div>
|
||||
|
||||
<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" sourceType="camera"></AiUploader>
|
||||
<AiUploader :def.sync="forms.images" multiple placeholder="上传图片" :limit="9" action="/admin/file/add2"
|
||||
sourceType="camera"></AiUploader>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
</div>
|
||||
@@ -58,11 +62,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import {mapState} from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'add',
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
@@ -103,7 +106,7 @@ export default {
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: { ...mapState(['user']) },
|
||||
computed: {...mapState(['user'])},
|
||||
onLoad(o) {
|
||||
this.id = o.id ? o.id : ''
|
||||
this.areaIdProps = this.user.areaId
|
||||
@@ -169,38 +172,38 @@ export default {
|
||||
const imgs = []
|
||||
if (this.forms.images) {
|
||||
this.forms.images.map((e) => {
|
||||
imgs.push({ url: e.url, id: e.id })
|
||||
imgs.push({url: e.url, id: e.id})
|
||||
})
|
||||
}
|
||||
|
||||
this.flag = true
|
||||
this.$http
|
||||
.post(`/app/appvisitvondolence/addOrUpdate`, {
|
||||
areaId: this.forms.areaId,
|
||||
name: this.forms.name,
|
||||
visitTime: this.forms.visitTime,
|
||||
optionId: this.forms.optionId,
|
||||
// menuLevel3Name: this.forms.menuLevel3Name,
|
||||
applicationId: this.forms.applicationId,
|
||||
.post(`/app/appvisitvondolence/addOrUpdate`, {
|
||||
areaId: this.forms.areaId,
|
||||
name: this.forms.name,
|
||||
visitTime: this.forms.visitTime,
|
||||
optionId: this.forms.optionId,
|
||||
// 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) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('保存成功')
|
||||
this.flag = false
|
||||
uni.$emit('updateList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
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) => {
|
||||
if (res.code == 0) {
|
||||
this.$u.toast('保存成功')
|
||||
this.flag = false
|
||||
uni.$emit('updateList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$u.toast('保存失败')
|
||||
}
|
||||
@@ -221,7 +224,7 @@ export default {
|
||||
},
|
||||
|
||||
toWalkObject() {
|
||||
uni.navigateTo({ url: `./selectType` })
|
||||
uni.navigateTo({url: `./selectType`})
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -235,8 +238,10 @@ export default {
|
||||
.header-description {
|
||||
padding-bottom: 162px;
|
||||
background: #f3f6f9;
|
||||
|
||||
::v-deep .u-form {
|
||||
background: #fff;
|
||||
|
||||
.u-form-item {
|
||||
.u-form-item__body {
|
||||
.u-form-item--right__content__slot {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<section class="AiAreaPicker">
|
||||
<ai-search-popup mode="bottom" ref="areaSelector" length="85%">
|
||||
<ai-search-popup mode="bottom" ref="areaSelector" length="85%" :disabled="disabled">
|
||||
<div slot="btn" @tap="handleInit">
|
||||
<slot v-if="$slots.default"/>
|
||||
<div v-else-if="isForm">
|
||||
@@ -21,8 +21,8 @@
|
||||
</div>
|
||||
<div/>
|
||||
<span v-if="all" v-text="`省`" @click="selectNode({}, -1)"/>
|
||||
<span v-for="(area,i) in fullArea" :key="area.id" v-text="area.levelLabel || '村/社区'"
|
||||
@click="selectNode(area, i)"/>
|
||||
<span v-for="(area,i) in fullArea.filter(e=>e.type<valueLevel)" :key="area.id"
|
||||
v-text="area.levelLabel || '村/社区'" @click="selectNode(area, i)"/>
|
||||
</div>
|
||||
<!--用来作为占位的-->
|
||||
<div class="fixedPlaceholder" style="line-height: 60px;" v-if="false">
|
||||
@@ -63,7 +63,9 @@ export default {
|
||||
icon: {default: "location.svg"},
|
||||
isForm: Boolean,
|
||||
valueLevel: {default: 5},
|
||||
fullName: {default: ''}
|
||||
fullName: {default: ''},
|
||||
disabled: Boolean,
|
||||
selectRoot: Boolean
|
||||
},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
@@ -73,14 +75,14 @@ export default {
|
||||
if (this.all) return (level = 0)
|
||||
rules.some((e, i) => {
|
||||
let reg = new RegExp(`0{${e}}`, 'g')
|
||||
if (reg.test(this.areaId || this.user.areaId || this.$areaId)) {
|
||||
if (reg.test(this.root)) {
|
||||
return (level = i)
|
||||
}
|
||||
})
|
||||
return level
|
||||
},
|
||||
currentArea() {
|
||||
return this.fullArea?.slice(-1)?.[0] || {}
|
||||
root() {
|
||||
return this.areaId || this.user.areaId || this.$areaId
|
||||
},
|
||||
locationIcon() {
|
||||
return this.$cdn + this.icon
|
||||
@@ -105,15 +107,15 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
areaId(v) {
|
||||
v && (this.getFullArea())
|
||||
v && (this.getFullArea(v))
|
||||
},
|
||||
|
||||
value(v) {
|
||||
if (this.list.length && v) {
|
||||
this.areaName = this.list.find((e) => e.id == this.value).name
|
||||
if (v) {
|
||||
this.getFullArea(v).then(list => {
|
||||
this.areaName = list?.reverse()?.[0]?.name
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
fullArea: {
|
||||
handler(v) {
|
||||
this.$nextTick(() => {
|
||||
@@ -135,9 +137,8 @@ export default {
|
||||
scrollHeight() {
|
||||
this.height = document.querySelector('.areaSelector') && `calc(100% - ${document.querySelector('.areaSelector').offsetHeight}px)`
|
||||
},
|
||||
getFullArea() {
|
||||
let areaId = this.areaId || (this.all ? '' : this.$areaId)
|
||||
return this.$http.post('/admin/area/getAllParentAreaId', null, {
|
||||
getFullArea(areaId) {
|
||||
return areaId && this.$http.post('/admin/area/getAllParentAreaId', null, {
|
||||
withoutToken: true,
|
||||
params: {areaId},
|
||||
}).then((res) => {
|
||||
@@ -149,7 +150,6 @@ export default {
|
||||
this.fullArea = res.data.reverse().slice(this.dataRange)
|
||||
} else {
|
||||
this.fullArea = res.data
|
||||
|
||||
}
|
||||
return this.fullArea
|
||||
}
|
||||
@@ -160,32 +160,16 @@ export default {
|
||||
withoutToken: true,
|
||||
params: {id},
|
||||
}).then((res) => {
|
||||
if (res.data.length) {
|
||||
if (res?.data) {
|
||||
this.list = res.data
|
||||
let self = this.fullArea.find((e) => e.id == this.areaId)
|
||||
|
||||
if (this.value && !this.areaName && this.value !== this.areaId) {
|
||||
this.areaName = this.list.find((e) => e.id == this.value)?.name
|
||||
}
|
||||
if (!this.areaName && this.value === this.areaId) {
|
||||
this.areaName = self.name
|
||||
}
|
||||
if (self?.id) {
|
||||
this.list.unshift(self)
|
||||
if (this.selectRoot) {
|
||||
let root = JSON.parse(JSON.stringify(this.fullArea?.[0]))
|
||||
this.list.unshift(root)
|
||||
}
|
||||
this.scrollHeight()
|
||||
} else {
|
||||
if (this.areaId.substr(this.areaId.length - 3, 3) !== '000') {
|
||||
this.list = [{
|
||||
id: this.areaId,
|
||||
name: this.fullArea[0].name
|
||||
}]
|
||||
this.areaName = this.fullArea[0].name
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getProvinces() {
|
||||
this.$http.post('/admin/area/queryProvinceList', null, {withoutToken: true}).then((res) => {
|
||||
if (res?.data) {
|
||||
@@ -234,16 +218,23 @@ export default {
|
||||
}
|
||||
},
|
||||
handleInit() {
|
||||
this.index = this.value || this.areaId
|
||||
|
||||
if (this.all && !this.areaId && !this.currentArea.id) {
|
||||
this.getProvinces()
|
||||
|
||||
return false
|
||||
this.index = this.value || this.root
|
||||
if (!this.disabled) {
|
||||
if (this.all) {
|
||||
this.getProvinces()
|
||||
return false
|
||||
} else if (this.value) {
|
||||
this.getFullArea(this.value).then(() => {
|
||||
let area = this.fullArea?.[0]
|
||||
if (area.type == this.valueLevel) this.getChildAreas(area.parentId)
|
||||
else this.getChildAreas(area.id)
|
||||
})
|
||||
} else {
|
||||
this.getFullArea(this.root).then(() => {
|
||||
this.getChildAreas(this.root)
|
||||
})
|
||||
}
|
||||
}
|
||||
this.getFullArea().then(() => {
|
||||
this.getChildAreas(this.currentArea.id || this.areaId)
|
||||
})
|
||||
},
|
||||
closePopup() {
|
||||
this.$refs.areaSelector?.handleSelect()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</u-popup>
|
||||
<div @tap="show=true">
|
||||
<div @tap="show= !disabled&&true">
|
||||
<slot name="btn"/>
|
||||
</div>
|
||||
</section>
|
||||
@@ -25,7 +25,8 @@ export default {
|
||||
ops: {default: () => ({label: 'label', search: 'name'})},
|
||||
url: String,
|
||||
mode: {default: "right"},
|
||||
length: {default: "100%"}
|
||||
length: {default: "100%"},
|
||||
disabled: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user