|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="content">
|
|
|
<div class="jjinfo">
|
|
|
- <van-field :value="recipientsName" @focus="onFocus" name="phone" label="收件人姓名" placeholder="请输入收件人姓名"
|
|
|
- :rules="[{ required: true }]" />
|
|
|
+ <van-field ref="searchRef" :value="recipientsName" @focus="onFocus" name="phone" label="收件人姓名"
|
|
|
+ placeholder="请输入收件人姓名" :rules="[{ required: true }]" />
|
|
|
<van-field :value="recipientsPhone" @focus="onFocusPhone" name="phone" label="收件人手机号"
|
|
|
placeholder="请输入手机号后四位" :rules="[{ required: true }]" />
|
|
|
<van-field :value="groupValue.departmentName" readonly name="phone" label="收件人部门" placeholder="自动填充" />
|
|
@@ -78,7 +78,8 @@
|
|
|
<!-- 姓名输入后弹出 -->
|
|
|
<van-popup v-model="nameShowA" :style="{ height: '100%', width: '100%', }">
|
|
|
<div style="display: flex; justify-content: space-between;">
|
|
|
- <van-search style="width: 100%;" @search="searchCrux" v-model="searchKey" placeholder="请输入搜索关键词" />
|
|
|
+ <van-search ref="searchNameRef" style="width: 100%;" @search="searchCrux" v-model="searchKey"
|
|
|
+ placeholder="请输入搜索关键词" />
|
|
|
</div>
|
|
|
<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
|
|
|
<van-cell-group class="vanPopup" @click="onGroup(item)" v-for="(item, index) in searchNameList"
|
|
@@ -94,13 +95,13 @@
|
|
|
<!-- 手机号输入后弹出 -->
|
|
|
<van-popup v-model="nameShowB" :style="{ height: '100%', width: '100%', }">
|
|
|
<div style="display: flex; justify-content: space-between;">
|
|
|
- <van-search style="width: 100%;" @search="searchCruxPhone" v-model="searchKeyPhone"
|
|
|
+ <van-search ref="searchPhoneRef" style="width: 100%;" @search="searchCruxPhone" v-model="searchKeyPhone"
|
|
|
placeholder="请输入手机后四位" />
|
|
|
</div>
|
|
|
<div style="height: calc(100vh - 105px); overflow-y: auto; padding: 0 20px;">
|
|
|
<van-cell-group class="vanPopup" @click="onGroupPhone(item)"
|
|
|
v-for="(item, index) in searchNameListPhone" :key="index" inset>
|
|
|
- <van-cell :value="item.departmentName">{{ item.name }}- {{ item.departmentName }} - {{ item.seatNo
|
|
|
+ <van-cell :value="item.departmentName">{{ item.name }}- {{ item.phone }} - {{ item.departmentName
|
|
|
}}</van-cell>
|
|
|
</van-cell-group>
|
|
|
</div>
|
|
@@ -192,15 +193,31 @@ export default {
|
|
|
this.userId = localStorage.getItem("userId");
|
|
|
this.accountType = localStorage.getItem("accountType")
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ // this.$refs.searchRef.focus();
|
|
|
+ },
|
|
|
methods: {
|
|
|
|
|
|
//姓名点击聚焦
|
|
|
onFocus() {
|
|
|
this.nameShowA = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.searchNameRef) {
|
|
|
+ const inputEle = this.$refs.searchNameRef.querySelector("input")
|
|
|
+ inputEle.focus()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 手机号点击聚焦
|
|
|
onFocusPhone() {
|
|
|
this.nameShowB = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (this.$refs.searchPhoneRef) {
|
|
|
+ const inputEle = this.$refs.searchPhoneRef.querySelector("input")
|
|
|
+ inputEle.focus()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
// 搜索关键
|
|
|
async searchCrux() {
|