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,11 +1,11 @@
<template>
<div class="AddGird">
<section class="AddGird">
<div class="item-flex">
<div class="label">
<span class="tips">*</span>姓名
</div>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="name" maxlength="50" />
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="name" maxlength="50"/>
</div>
</div>
<div class="item-flex">
@@ -13,24 +13,26 @@
<span class="tips">*</span>手机号
</div>
<div class="value">
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="phone" maxlength="50" />
<u-input type="text" placeholder="请输入" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" v-model="phone" maxlength="50"/>
</div>
</div>
<div class="item-flex">
<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>
<div class="footer" @click="confirm">确认添加</div>
</div>
</section>
</template>
<script>
import {mapState} from 'vuex'
export default {
data() {
return {
@@ -41,25 +43,21 @@ 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 = '网格员信息申报'
},
methods: {
confirm() {
if(!this.name){
if (!this.name) {
return this.$u.toast('请输入姓名')
}
if(!this.phone){
if (!this.phone) {
return this.$u.toast('请输入手机号')
}
if(!this.selectGird.girdName){
if (!this.selectGird.girdName) {
return this.$u.toast('请选择所属网格')
}
this.$http.post(`/app/appgirdmemberapply/girdMemberCheck?name=${this.name}&phone=${this.phone}&girdName=${this.selectGird.girdName}`).then((res) => {
@@ -73,7 +71,7 @@ export default {
},
linkTo(url) {
uni.navigateTo({ url })
uni.navigateTo({url})
},
}
}
@@ -81,42 +79,48 @@ export default {
<style lang="scss" scoped>
.AddGird {
.item-flex{
.item-flex {
display: flex;
padding: 34px 32px;
background-color: #fff;
font-size: 32px;
font-family: PingFangSC-Regular, PingFang SC;
margin-bottom: 16px;
.label{
.label {
font-weight: 400;
color: #333333;
line-height: 22px;
width: 150px;
.tips{
.tips {
display: inline-block;
width: 16px;
color: #F46;
line-height: 44px;
}
}
.value{
.value {
width: calc(100% - 150px);
line-height: 44px;
text-align: right;
color: #666;
img{
img {
width: 32px;
height: 32px;
vertical-align: middle;
margin-left: 8px;
}
}
.color-999{
.color-999 {
color: #999;
}
}
.footer{
.footer {
width: 100%;
height: 112px;
line-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)
}