linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<template>
    <view class="">
        <view class="footer flex a-i-c j-c-s-b">
            <button v-if="dataItem.type === 1 && dataItem.status === 1" class="footer-btn"
                @click="submit(2)">通过</button>
            <button v-if="dataItem.type === 2 && dataItem.status === 1" class="footer-btn"
                @click="submitTwo(2)">通过</button>
            <button class="footer-btn" v-if="(dataItem.status === 1 || dataItem.confirmFlag === 1)"
                @click="open()">驳回</button>
            <button class="footer-btn" v-if="dataItem.status === 2" @click="show = true">共享</button>
        </view>
        <u-modal :show="isShowModal" title="备注" :showConfirmButton="false" :closeOnClickOverlay="true" @click="close">
            <view class="modal-content">
                <u-textarea v-model="remark" placeholder="请输入驳回原因"></u-textarea>
                <view class="modal-btn flex j-c-s-b a-i-c" slot="confirmButton">
                    <button class="modal-btn-item c-main f-30" @click="isShowModal = false">取消</button>
                    <button class="modal-btn-item bgc-main f-30 c-ff" @click="submit(3)">确定</button>
                </view>
            </view>
        </u-modal>
 
        <u-popup :show="show" mode="bottom" @close="close" :round="10" :closeable="true">
            <view class="popup-title">
                共享
            </view>
            <view style="margin-top: 20rpx 0rpx;" class="popup-content">
                <u-radio-group v-model="radiovalue1" @change="groupChange" iconPlacement="right" placement="column">
                    <view v-for="(item, index) in radiolist1" style="padding:10rpx 0;">
                        <u-radio :customStyle="{marginBottom: '8px'}" :key="index" :label="item.name" :name="item.id"
                            @change="radioChange">
                        </u-radio>
                    </view>
                </u-radio-group>
                <view class="popup-btn flex a-i-c j-c-s-b">
                    <button class="popup-btn-item" @click="pushCircle">确认</button>
                </view>
            </view>
        </u-popup>
 
        <u-modal :show="isShowModalTwo" title="备注" :showConfirmButton="false">
            <view class="modal-content">
                <u-search placeholder="请输入场所名称" :clearabled="true" @blur="searchPlace()" v-model="placeName"></u-search>
 
                <u-radio-group v-model="houseCode" placement="column" @change="groupChange">
                    <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in placeList" :key="index"
                        :label="item.placeName +'----场所地址:'+item.location" :name="item.houseCode" @change="radioChange">
                    </u-radio>
                </u-radio-group>
 
                <view class="modal-btn flex j-c-s-b a-i-c" slot="confirmButton">
                    <button class="modal-btn-item c-main f-30" @click="isShowModalTwo = false">取消</button>
                    <button class="modal-btn-item bgc-main f-30 c-ff" @click="submit(2)">确定</button>
                </view>
            </view>
        </u-modal>
 
    </view>
</template>
 
<script>
    import {
        getLocationRecord
    } from "@/api/place/place";
    import {
        handlePublish
    } from '@/api/circle/circle.js'
 
    export default {
        name: "auditAction",
        data() {
            return {
                isShowModal: false,
                isShowModalTwo: false,
                show: false,
                remark: "",
                placeName: '',
                houseCode: '',
                dataItem: {},
                placeList: [],
                radiovalue1: 0,
                // 基本案列数据
                radiolist1: [{
                        name: '邻里圈',
                        disabled: false,
                        id: 0
                    },
                    {
                        name: '协同圈',
                        disabled: false,
                        id: 1
                    }
                ],
            }
        },
        props: ['dataItem'],
        computed() {
            console.log("*********1******", dataItem)
        },
 
        methods: {
            pushCircle() {
                handlePublish({
                    houseCode: this.dataItem.houseCode,
                    eventId: this.dataItem.id,
                    // 无诈
                    evenType: 6,
                    circleType: this.radiovalue1,
                    circleText: this.dataItem.placeName,
                    circleImages: this.dataItem.images
                }).then(res => {
                    this.$showTips("操作成功", "success")
                    this.close()
                    // this.$set(this.peopleList, 1, res.data);
                })
            },
 
            groupChange(n) {
                this.houseCode = n
                console.log('groupChange', n);
            },
            radioChange(n) {
                console.log('radioChange', n);
            },
            open() {
                this.isShowModal = true;
            },
            close() {
                this.show = false
                this.isShowModal = false;
            },
 
            submitTwo(type) {
                // console.log("*****111*******", JSON.stringify(this.dataItem))
                this.isShowModalTwo = true
            },
 
 
            searchPlace() {
                if (!this.placeName) {
                    return
                }
                getLocationRecord({
                    roleName: 'admin',
                    current: 1,
                    size: 30,
                    isPerfect: 2,
                    placeName: this.placeName,
                    isNine: 1
                }).then(res => {
                    this.placeList = res.data.records;
                    this.placeList.forEach(item => {
                        item.isSelect = false
                    })
                })
            },
 
            submit(type) {
                let data = {
                    type,
                    remark: this.remark,
                    houseCode: this.houseCode
                }
 
                if (type == 3 && !this.remark) {
                    uni.showToast({
                        title: "请输入驳回原因",
                        icon: "none"
                    })
                    return
                }
 
                this.$emit("handle", data)
                if (type == 3) {
                    this.close()
                }
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .footer {
        width: 100%;
        padding: 20rpx 30rpx;
        box-sizing: border-box;
        position: fixed;
        bottom: 0;
        left: 0;
        background-color: #fff;
        z-index: 10;
        padding-bottom: calc(env(safe-area-inset-bottom) + 20rpx);
        z-index: 999;
        background-color: #fff;
        box-shadow: 0rpx 0rpx 10rpx 1rpx rgba(0, 0, 0, 0.1);
 
        .footer-btn {
            width: 200rpx;
            height: 78rpx;
            border-radius: 8rpx;
            font-size: 32rpx;
            color: #fff;
            border: none;
            background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
        }
 
        .footer-btn:after {
            border: none;
        }
 
    }
 
 
    .modal-content {
        width: 100%;
 
        .modal-btn {
            width: 100%;
            padding: 40rpx 0 0;
 
            .modal-btn-item {
                width: 240rpx;
                height: 74rpx;
                line-height: 74rpx;
                border-radius: 35rpx;
                border: none;
                padding: 0;
                margin: 0;
            }
 
            .modal-btn-item:first-child {
                border: 1px solid currentColor;
                background: transparent;
            }
 
        }
    }
 
 
    .popup-title {
        padding: 20rpx 0;
        text-align: center;
    }
 
    .popup-content {
        padding: 20rpx;
    }
 
    .popup-btn {
        padding: 20rpx;
 
 
        .popup-btn-item {
            width: 100%;
            height: 78rpx;
            line-height: 78rpx;
            border-radius: 36rpx;
            color: #fff;
            background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
            font-size: 28rpx;
        }
 
        .popup-btn-item:after {
            border: none;
        }
    }
 
    /deep/ .u-modal__content {
        padding-bottom: 20rpx !important;
    }
</style>