This commit is contained in:
zhutianqi
2021-12-22 10:14:05 +08:00
parent 4f01901e8f
commit 9547f5a992
20 changed files with 62 additions and 52 deletions
+30 -13
View File
@@ -3,6 +3,7 @@
<van-action-sheet
v-model="isShowPhone2"
:title="roleTitle"
v-if="isShowPhone2"
>
<el-form
ref="phoneForm"
@@ -32,7 +33,7 @@
:immediate-check="false"
:offset="300"
>
<van-checkbox-group v-if="!checkMore" v-model="result" :max="1">
<van-checkbox-group v-if="!checkMore" v-model="result" :max="1" @change="itemChange">
<van-cell-group>
<van-cell
v-for="(item, index) in roleList"
@@ -42,12 +43,12 @@
@click="toggle(index)"
>
<template #right-icon>
<van-checkbox :name="item" ref="checkbox"/>
<van-checkbox :name="item.usId" ref="checkbox"/>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
<van-checkbox-group v-if="checkMore" v-model="result">
<van-checkbox-group v-if="checkMore" v-model="result" @change="itemChange">
<van-cell-group>
<van-cell
v-for="(item, index) in roleList"
@@ -57,7 +58,7 @@
@click="toggle(index)"
>
<template #right-icon>
<van-checkbox :name="item" ref="checkbox"/>
<van-checkbox :name="item.usId" ref="checkbox"/>
</template>
</van-cell>
</van-cell-group>
@@ -125,21 +126,18 @@ export default {
},
isShowPhone2(val) {
this.$emit('update:isShowPhone', val)
},
resultList (val) {
this.result = val
},
result() {
this.$emit('resultList', this.result)
}
},
mounted() {
this.getPhoneData()
},
methods: {
itemChange (data) {
},
/** 查询 */
queryPhone() {
this.getPhoneData()
this.finished = false
},
/** 获取人员数据 */
async getPhoneData() {
@@ -170,22 +168,41 @@ export default {
},
roleSumit() {
this.$emit('checkedRole', this.result)
this.isShowPhone2 = false
let ids = ''
this.result.map(item => {
if (ids.length > 0) {
ids += ','
ids += item
} else {
ids = item
}
})
this.$http.get('SarInstitution/institution/getNextById', {
ids: ids
}, {
_this: this
}, res => {
this.$emit('checkedRole', res)
this.isShowPhone2 = false
this.phoneForm.name = ''
this.getPhoneData()
})
},
roleClear() {
this.result = []
this.isShowPhone2 = false
this.phoneForm.name = ''
this.getPhoneData()
},
// 下滑加载数据
onLoad() {
this.phoneForm.page++
phoneUser(this.phoneForm).then(res => {
this.roleList = this.roleList.concat(res.data)
this.total = this.roleList[0].total
this.loading = false
if (this.roleList.length < this.total) {
this.phoneForm.page ++
this.loading = false
} else {
this.finished = true