<template>
|
<view class="box">
|
<u-sticky offset-top="0">
|
<view class="box_search">
|
<u-search placeholder="搜索姓名" :showAction="false" :clearabled="true" v-model="keyword" @search="search"></u-search>
|
</view>
|
</u-sticky>
|
<view class="box_list">
|
<u-checkbox-group
|
v-model="checkboxValue7"
|
@change="checkboxChange"
|
:borderBottom="true"
|
placement="column"
|
iconPlacement="right"
|
>
|
<u-checkbox
|
:customStyle="{marginBottom: '20px'}"
|
v-for="(item, index) in checkboxList7"
|
:key="index"
|
:label="item.name1"
|
:name="index"
|
>
|
</u-checkbox>
|
</u-checkbox-group>
|
</view>
|
<view class="box_zw"></view>
|
<view class="box_footer">
|
<u-button type="primary" shape="circle" color="#437CB3" text="确认添加" @click="submit"></u-button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
checkboxList7: [],
|
checkboxValue7: [],
|
list: [],
|
keyword: '',
|
insuranceApplyId: '',
|
validTime: ''
|
};
|
},
|
onLoad(option) {
|
this.insuranceApplyId = option.insuranceApplyId
|
this.validTime = option.validTime
|
this.getList()
|
},
|
methods: {
|
submit() {
|
if (this.checkboxValue7.length === 0) return uni.showToast({
|
title: '至少选择一名人员',
|
icon: 'none'
|
})
|
let arr = []
|
this.checkboxValue7.forEach(index => {
|
arr.push(this.checkboxList7[index])
|
})
|
uni.$emit('del', arr.map(item => {
|
return {
|
id: item.id,
|
pqId: item.pqId,
|
pqId: item.duId,
|
pqName: item.duName,
|
idCard: item.idcardNo,
|
name: item.name,
|
gzName: item.workTypeName,
|
gzId: item.worktypeId
|
}
|
}))
|
uni.navigateBack({ delta: 1 });
|
},
|
checkboxChange(n) {
|
console.log('change', n);
|
},
|
search() {
|
this.checkboxList7 = []
|
this.getList()
|
},
|
jump(row) {
|
console.log(row);
|
},
|
getList() {
|
this.$u.api.memberFindListByDTO({
|
insuranceApplyId: this.insuranceApplyId,
|
name: this.keyword,
|
validTime: this.validTime
|
}).then(res => {
|
if (res.code === 200) {
|
res.data.forEach(item => {
|
item.name1 = item.name + ' - ' + item.idcardNo
|
})
|
this.checkboxList7 = res.data
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
.box_search {
|
padding: 12rpx 30rpx;
|
box-sizing: border-box;
|
background-color: #ffffff;
|
}
|
.box_list {
|
width: 100%;
|
padding: 20rpx 30rpx;
|
box-sizing: border-box;
|
}
|
.box_zw {
|
width: 100%;
|
height: calc(env(safe-area-inset-bottom) + 30rpx + 88rpx);
|
}
|
.box_footer {
|
width: 100%;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
position: fixed;
|
left: 0;
|
bottom: calc(env(safe-area-inset-bottom) + 30rpx);
|
.box_footer_btn {
|
width: 100%;
|
height: 88rpx;
|
line-height: 88rpx;
|
text-align: center;
|
background: #437CB3;
|
border-radius: 44rpx;
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #FFFFFF;
|
}
|
}
|
}
|
</style>
|