BUG 30109

This commit is contained in:
aixianling
2022-06-08 15:33:49 +08:00
parent 644baa798b
commit 7ba8dae87a
3 changed files with 36 additions and 30 deletions

View File

@@ -22,7 +22,8 @@ export default {
nodeKey: {default: "idNumber"},
selected: {default: () => []},
placeholder: {default: "选择人员"},
ops: {default: () => ({})}
ops: {default: () => ({})},
valueObj: Boolean
},
data() {
return {
@@ -46,13 +47,13 @@ export default {
},
methods: {
handleJump() {
let {config, nodeKey} = this,
selected = this.value || this.selected?.map(e => e[nodeKey])
let {config, nodeKey, valueObj} = this,
selected = (valueObj ? this.value[nodeKey] : this.value) || this.selected?.map(e => e[nodeKey])
uni.$once('pagePicker:' + this.type, data => {
console.log('发送', data)
this.$emit("update:selected", data)
this.$emit("select", data)
this.$emit("change", data ? [data].flat()?.map(e => e[nodeKey]) : "")
this.$emit("change", valueObj ? data : data ? [data].flat()?.map(e => e[nodeKey]) : "")
})
let url = `${config.url}`,
qsstr = qs.stringify({

View File

@@ -1,5 +1,5 @@
<template>
<div class="AddGird">
<section class="AddGird">
<div class="item-flex">
<div class="label">
<span class="tips">*</span>姓名
@@ -20,17 +20,19 @@
<div class="label">
<span class="tips">*</span>所属网格
</div>
<div class="value" @click="linkTo('./SelectGird?formType=2')">
<span v-if="selectGird.girdName">{{selectGird.girdName}}</span>
<span style="color:#999;" v-else>请选择</span>
<img src="./components/img/right-icon.png" alt="" /></div>
<div class="value">
<AiPagePicker type="custom" v-model="selectGird" valueObj nodeKey="id" :ops="{url:'./SelectGird',label: 'girdName'}" formType="2">
<AiMore v-model="selectGird.girdName"/>
</AiPagePicker>
</div>
<div class="footer" @click="confirm">确认添加</div>
</div>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
@@ -41,12 +43,8 @@ export default {
},
computed: {...mapState(['user'])},
onLoad() {
console.log(this.user)
this.name = this.user.name || ''
this.phone = this.user.phone || ''
uni.$on('goback', (res) => {
this.selectGird = res
})
},
onShow() {
document.title = '网格员信息申报'
@@ -88,11 +86,13 @@ export default {
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
margin-bottom: 16px;
.label {
font-weight: 400;
color: #333333;
line-height: 22px;
width: 150px;
.tips {
display: inline-block;
width: 16px;
@@ -100,11 +100,13 @@ export default {
line-height: 44px;
}
}
.value {
width: calc(100% - 150px);
line-height: 44px;
text-align: right;
color: #666;
img {
width: 32px;
height: 32px;
@@ -112,10 +114,12 @@ export default {
margin-left: 8px;
}
}
.color-999 {
color: #999;
}
}
.footer {
width: 100%;
height: 112px;

View File

@@ -55,7 +55,8 @@ export default {
return this.user.girdCheckType > 0
},
//是否是网格员申报
isApply: v => v.$route.query.formType == 2
isApply: v => v.$route.query.formType == 2,
selected: v => [v.$route.query.selected].flat()
},
onLoad(option) {
if (option.isFormMap) {
@@ -98,7 +99,7 @@ export default {
})
} else {
this.treeList = this.allData.filter(e => !e.parentGirdId || this.isMyGirds)
this.treeList.map((item) => item.isChecked = false)
this.treeList.map((item) => item.isChecked = this.selected.includes(item.id))
let obj = {girdName: '可选范围', id: ''}
this.slectList.push(obj)
}