MrShi
2024-04-07 9a819fa35464df79a1a8a56e132b3463fac520a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<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>