jialh
2025-08-01 17ea4b4d7b1ddf8d4eb345af7440df9b42df9614
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<template>
    <view>
        <view v-if="owners.length>0">
            <view class="block__title">成员信息</view>
            <view v-for="(item,index) in owners" :key="index"
                class="bg-white margin-bottom margin-right-xs radius margin-left-xs padding">
                <view class="flex padding-bottom-xs solid-bottom justify-between">
                    <view>{{item.name}}</view>
                    <view class="text-gray">{{item.link}}</view>
                </view>
                <view class="flex margin-top justify-between">
                    <view class="text-gray">成员编号</view>
                    <view class="text-gray">{{item.memberId}}</view>
                </view>
                <view class="flex margin-top-xs justify-between">
                    <view class="text-gray">身份证号</view>
                    <view class="text-gray">{{item.idCard}}</view>
                </view>
                <!-- <view class="flex margin-top-xs justify-between">
                    <view class="text-gray">成员年龄</view>
                    <view class="text-gray">{{item.age}}岁</view>
                </view> -->
                <view class="flex margin-top-xs justify-between">
                    <view class="text-gray">成员性别</view>
                    <view class="text-gray">{{item.sex == 0? '男': '女'}}</view>
                </view>
 
                <view class="solid-top flex justify-end margin-top padding-top-sm padding-bottom-sm">
                    <button class="cu-btn sm bg-green " @click="_updateOwnerMember(item)">修改</button>
                    <button class="cu-btn sm bg-red " @click="_deleteOwnerMember(item)">删除</button>
                </view>
            </view>
        </view>
        <view v-else>
            <no-data-page></no-data-page>
        </view>
        <view class="button_up_blank"></view>
 
        <view v-if="ownerTypeCd == '1001'" class="bg-white  border flex justify-end"
            style="position: fixed;width: 100%;bottom: 0;">
            <view class="action text-orange margin-right line-height">
 
            </view>
            <view class="btn-group">
                <button class="cu-btn bg-green shadow-blur lgplus sharp" @click="goAdd()">添加成员</button>
            </view>
        </view>
 
        <view class="cu-modal" :class="delOwnerMemberFlag==true?'show':''">
            <view class="cu-dialog">
                <view class="cu-bar bg-white justify-end">
                    <view class="content">温馨提示</view>
                    <view class="action" @tap="_cancleDeleteOwnerMember()">
                        <text class="cuIcon-close text-red"></text>
                    </view>
                </view>
                <view class="padding-xl">
                    您确认删除该成员?
                </view>
                <view class="cu-bar bg-white justify-end">
                    <view class="action margin-0 flex-sub  solid-left" @tap="_cancleDeleteOwnerMember()">取消</view>
                    <view class="action margin-0 flex-sub text-green solid-left" @tap="_doDeleteOwnerMember()">确认</view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import context from '../../lib/java110/Java110Context.js';
    const constant = context.constant;
    import noDataPage from '@/components/no-data-page/no-data-page.vue';
 
    import {
        deleteOwnerMember
    } from '../../api/owner/ownerApi.js'
    export default {
        data() {
            return {
                owners: [],
                delOwnerMemberFlag: false,
                page: 1,
                totalPage: 0,
                loading: false,
                communityId: '',
                ownerId: '',
                curOwnerMember: {},
                ownerTypeCd: '',
            };
        },
        components: {
            noDataPage
        },
        onLoad: function(options) {
            context.onLoad(options);
        },
        onShow: function() {
            this._initData();
 
        },
        methods: {
            _initData: function() {
                let that = this;
                that.owners = [];
                context.getOwner(function(_owner) {
                    that.communityId = _owner.communityId;
                    that.ownerId = _owner.ownerId;
                    that.ownerTypeCd = _owner.ownerTypeCd;
                    that.getTable(1);
                });
            },
            getTable: function(page, override) {
                let that = this;
                this.loading = true;
                let _paramIn = {
                    "communityId": that.communityId,
                    "ownerId": that.ownerId
                };
                context.request({
                    url: constant.url.queryOwnerMembers,
                    header: context.getHeaders(),
                    method: "GET",
                    data: _paramIn,
                    success: function(res) {
                        let _json = res.data;
                        if (_json.code == 0) {
                            that.owners = _json.data;
                            that.loading = false;
                        }
                    },
                    fail: function(e) {
                        wx.showToast({
                            title: "服务器异常了",
                            icon: 'none',
                            duration: 2000
                        })
                    }
                })
            },
            goAdd: function(e) {
                this.vc.navigateTo({
                    url: "/pages/family/family"
                })
            },
            _updateOwnerMember(item) {
                this.vc.navigateTo({
                    url: `/pages/family/familyUpdate?memberId=${item.memberId}`
                });
            },
            _deleteOwnerMember: function(item) {
                this.delOwnerMemberFlag = true;
                this.curOwnerMember = item;
            },
            _cancleDeleteOwnerMember: function(item) {
                this.delOwnerMemberFlag = false;
            },
            _doDeleteOwnerMember: function() {
                let that = this;
                this.curOwnerMember.communityId = this.communityId;
                deleteOwnerMember(this.curOwnerMember)
                    .then((res) => {
                        uni.showToast({
                            icon: 'none',
                            title: '删除成功'
                        });
                        that._cancleDeleteOwnerMember();
                        that._initData();
                    }, (err) => {
                        uni.showToast({
                            icon: 'none',
                            title: err
                        });
                        that._cancleDeleteOwnerMember();
                    })
            }
        }
    };
</script>
<style>
    .ppf_item {
        padding: 0rpx 0rpx 0rpx 0rpx;
    }
 
    .block__title {
        margin: 0;
        font-weight: 400;
        font-size: 14px;
        color: rgba(69, 90, 100, .6);
        padding: 40rpx 30rpx 20rpx;
    }
 
    .button_up_blank {
        height: 100rpx;
    }
 
    .cu-btn.lgplus {
        padding: 0 20px;
        font-size: 18px;
        height: 100upx;
 
    }
 
    .cu-btn.sharp {
        border-radius: 0upx;
    }
 
    .line-height {
        line-height: 100upx;
    }
</style>