“dzb”
2022-09-30 053a40db4fcbcbafb89a346ff17695b150745782
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<template>
    <div class="ill">
        <div class="input-area">
            <div class="input-header">
                <div class="input-header__title">基础信息</div>
                <div class="input-header__tip">填写事件基础信息</div>
            </div>
            <div class="input-form">
                <el-form ref="user" label-width="160px" autoComplete="on" :model="role" :rules="createRoleRules"
                    label-position="right">
                    <!-- 问题类型 -->
                    <el-form-item class="optionItem" label="问题类型:" prop="name">
                        <el-select v-model="role.type" placeholder="违建">
                            <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"
                                :disabled="item.disabled">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 违建类别 -->
                    <el-form-item class="optionItems" label="违建类别:" prop="status">
                        <el-select v-model="role.big" placeholder="请选择违建类别" size="small">
                            <el-option v-for="item in bigKindList" :key="item.id" :label="item.name" :value="item.id"
                                :disabled="item.disabled">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 当事人姓名 -->
                    <el-form-item class="optionItems" label="当事人姓名:" prop="status">
                        <el-input placeholder="请填写当事人姓名"></el-input>
                    </el-form-item>
                    <!-- 当事人身份证号 -->
                    <el-form-item class="optionItems" label="当事人身份证号:" prop="status">
                        <el-input placeholder="请填写当事人身份证号"></el-input>
                    </el-form-item>
                    <!-- 当事人联系电话 -->
                    <el-form-item class="optionItem" label="当事人联系电话:" prop="description">
                        <el-input v-model="role.description" placeholder="请填写当事人联系电话"></el-input>
                    </el-form-item>
                    <!-- 违建地点 -->
                    <el-form-item class="optionItems" label="违建地点:" prop="status">
                        <el-input placeholder="请填写违建地点"></el-input>
                    </el-form-item>
                    <!-- 所属社区 -->
                    <el-form-item class="optionItems" label="所属社区:" prop="status">
                        <el-select v-model="role.type" placeholder="请选择所属社区">
                            <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"
                                :disabled="item.disabled">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 身份证正反面照片 -->
                    <el-form-item class="optionItems" label="身份证正反面照片:" prop="status">
                        <template>
                            <div class="idcard">
                                <el-upload class="upload-demo"
                                    :show-file-list = "false"
                                    action="http://42.193.1.25:8082/sccg/file/medias"
                                    :headers="getToken()" multiple :limit="50">
                                    <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
                                        alt="">
                                        <span class="text">身份证正面</span>
                                </el-upload>
                                <el-upload class="upload-demo" 
                                    :show-file-list = "false"
                                    action="http://42.193.1.25:8082/sccg/file/medias"
                                    :headers="getToken()" multiple :limit="50">
                                    <img src="https://axure-file.lanhuapp.com/90466432-c999-4bf0-80b8-ee3f96a2099e__15f765432d579a14b8f6591c100d30e3.svg"
                                        alt="">
                                    <span class="text">身份证反面</span>
                                </el-upload>
                            </div>
                        </template>
                    </el-form-item>
                </el-form>
            </div>
            <div class="not-need">
                <div class="not-need__header">
                    执法违建情况
                </div>
                <div class="not-need-item">
                    <label>违建具体位置:</label>
                    <input type="text" class="not-need__inner">
                </div>
                <div class="not-need-item">
                    <label>违法建设长、宽、高:</label>
                    <input type="text" class="not-need__inner">
                </div>
                <div class="not-need-item">
                    <label>违法建设面积:</label>
                    <input type="text" class="not-need__inner">
                </div>
                <div class="not-need-item">
                    <label>违法建筑材料:</label>
                    <input type="text" class="not-need__inner">
                </div>
            </div>
            <div class="input-footer">
                <el-button type="primary" class="confirm">确定</el-button>
                <el-button class="back">返回</el-button>
            </div>
        </div>
        <div class="map-area">
            <!-- <MyMap /> -->
        </div>
    </div>
</template>
<script>
import MyMap from '@/components/map'
export default {
    components: {
        MyMap
    },
    data() {
        const validateNickname = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写问题类型"));
            } else {
                callback();
            }
        };
        const validatePass = (rule, value, callback) => {
            if (!value) {
                callback();
            } else {
                // const rep = /^\w+$/;
                // if (!rep.test(value)) {
                //     callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串"));
                // }
                callback();
            }
        };
        const validateTruename = (rule, value, callback) => {
            if (value) {
                callback();
            } else {
                // const rep = /^[\u4E00-\u9FA5]{2,4}$/;
                // if (!rep.test(value)) {
                //     callback("请输入正确的用户姓名");
                // }
                callback();
            }
        };
        return {
            role: {
                name: '',
                type: '',
                description: '',
            },
            createRoleRules: {
                name: [
                    { required: true, trigger: "blur", validator: validateNickname },
                ],
                type: [
                    { required: false, trigger: "blur", validator: validatePass },
                ],
                description: [
                    { required: false, trigger: "blur", validator: validateTruename },
                ],
            },
            bigKindList: [],
            typeList: [],
        }
    },
    created() {
        const { getBigKind, getEventLevel, getSmallKind } = this;
        getBigKind();
    },
    methods: {
        handleUser() {
            this.$refs['user'].validate((valid) => {
                console.log(valid);
                if (valid) {
                    const { role } = this;
                    console.log(role);
                    this.$axios.post('sccg/role/create', {
                        description: role.description, name: role.name, type: role.type
                    }).then(res => {
                        if (res.code === 200) {
                            this.refresh();
                        }
                    })
                } else {
                    return false;
                }
            })
        },
        handleStop() {
            this.refresh();
        },
        // 获取大类列表
        getBigKind() {
            this.$axios({
                method: 'get',
                url: 'sccg/illegal_building/query/type_second'
            }).then(res => {
                this.bigKindList = res.data;
                // console.log(res);
            })
        },
        // 获取行政区域
        // 获取token
        getToken() {
            const token = sessionStorage.getItem('token');
            const tokenHead = sessionStorage.getItem('tokenHead');
            if (token && tokenHead) {
                return { Authorization: tokenHead + token };
            }
        }
    }
}
</script>
<style lang="scss" scoped>
.ill {
    display: flex;
 
    .input-area {
        flex: 1;
        padding: 10px 20px;
 
        .input-header {
            color: #4b9bb7;
 
            .input-header__title {
                line-height: 60px;
                font-weight: 650;
                font-size: 20px;
            }
 
            .input-header__tip {
                line-height: 40px;
            }
        }
 
        .input-form {
 
            &::v-deep .el-input__inner {
                background-color: #09152f;
                border: 1px solid #17324c;
            }
 
            &::v-deep .el-textarea__inner {
                background-color: #09152f;
                border: 1px solid #17324c;
            }
            .upload-demo{
                position: relative;
                .text{
                    position: absolute;
                    top: 22%;
                    left: 20%;
                }
            }
            .idcard {
                display: flex;
            }
 
            .idCardZ {
                width: 200px;
                height: 200px;
            }
        }
 
        .input-footer {
            display: flex;
            justify-content: center;
        }
    }
 
    .map-area {
        flex: 1;
    }
 
    .not-need {
        .not-need__header {
            line-height: 40px;
        }
 
        .not-need-item {
            line-height: 40px;
            margin-bottom: 22px;
            display: flex;
 
            label {
                width: 160px;
                padding-right: 12px;
                text-align: right;
            }
 
            .not-need__inner {
                flex: 1;
                line-height: 40px;
                padding: 0 15px;
                border-radius: 4px;
                color: #fff;
                // outline: #409eff solid 1px;
                outline: none;
                background-color: #09152f;
                border: 1px solid #17324c;
            }
        }
    }
}
</style>