zhanghua
2025-04-14 829f5116884f98643ffc5b2a548a600d40c0cedb
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
<template>
    <div class="createUser">
        <main>
            <div class="mainContent">
                <el-form ref="user" :rules="createThings" label-width="140px" autoComplete="on" :model="things" label-position="right">
                    <!-- 违规事项编号 -->
                    <!-- <el-form-item class="optionItem" label="违规事项编号:" prop="number">
                        <el-input v-model="things.number" placeholder="请填写违规事项编号"></el-input>
                    </el-form-item>  -->
                    <!-- 新增的类型或大类或小类 -->
                    <el-form-item class="optionItem" label="新增名称:" prop="name">
                        <el-input v-model="things.name" placeholder="请输入新增名称"></el-input>
                    </el-form-item>
                    <!-- 所属类型 -->
                    <el-form-item class="optionItems" label="所属类型:" prop="typeThird">
                        <el-select v-model="things.typeThird" placeholder="请选择所属类型" >
                            <el-option v-for="item in typeThirdList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 所属大类 -->
                    <el-form-item class="optionItem" label="所属大类:" prop="typeSecond">
                        <el-select v-model="things.typeSecond" placeholder="请选择所属类型" >
                            <el-option v-for="item in typeSecondList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 请输入新增等级 -->
                    <el-form-item class="optionItem" label="案件等级:" prop="level">
                        <el-select v-model="things.level" placeholder="请选择所属类型" >
                            <el-option v-for="item in eventLevelList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <!-- 所属小类 -->
                    <!-- <el-form-item class="optionItem" label="所属小类:" prop="typeFirst">
                        <el-select v-model="things.typeFirst" placeholder="请选择所属类型" disabled>
                            <el-option v-for="item in typeFirstList" :key="item.id" :label="item.name"
                                :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item> -->
                    <!-- 案由 -->
                    <el-form-item class="optionItem" label="案由:" prop="type">
                        <el-input type="textarea" autosize v-model="things.type" placeholder="请输入案由描述内容"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <div class="optionBtn">
                            <el-button type="primary" class="btn submit" @click.native.prevent="handleSubmit">确认
                            </el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </main>
    </div>
</template>
<script>
export default {
    data() {
        const checkName = (rule,value,callback)=>{
            if(value){
                callback();
            }else{
                callback(new Error('新增违规类型不能为空'));
            }
        }
        const checkLevel = (rule,value,callback)=>{
            if(value){
                callback();
            }else{
                callback(new Error('新增违规等级不能为空'));
            }
        }
        return {
            things: {
                // number: 0,
                // type: '',
                name:'',
                typeFirst: '',
                typeSecond: '',
                typeThird: '',
                level:'',
            },
            createThings:{
                name:[
                    {
                        required:true,trigger:'blur',validator:checkName
                    }
                ],
                level:[
                    {
                        required:true,trigger:'change',validator:checkLevel
                    }
                ]
            },
            roleList: [],
            typeThirdList:[],
            typeSecondList:[],
            // typeFirstList:[],
            eventLevelList:[]
        }
    },
    created() {
        // 获取所属类型列表
        this.getTypeThird();
        this.getTypeSecond();
        // this.getTypeFirst();
        this.getEventLevel();
    },
    methods: {
        // 查询所属类型
        getTypeThird() {
            this.$axios({
                method: 'get',
                url: "sccg/violations/query/type_first",
            })
                .then(res => {
                    this.typeThirdList = res.data;
                })
        },
        // 查询所属大类
        getTypeSecond(){
            this.$axios({
                method: 'get',
                url: "sccg/violations/query/type_second",
            })
                .then(res => {
                    this.typeSecondList = res.data;
                })
        },
        // 查询所属小类
        // getTypeFirst(){
        //     this.$axios({
        //         method: 'get',
        //         url: "sccg/violations/query/type_third",
        //     })
        //         .then(res => {
        //             this.typeFirstList = res.data;
        //         })
        // },
        // 获取案件等级列表
        getEventLevel() {
            this.$axios({
                method: 'get',
                url: 'sccg/violations/query/event_type'
            })
                .then(res => {
                    this.eventLevelList = res.data;
                })
        },
        // 提交新增违规类型
        handleSubmit(){
        }
    },
    props: ['getUserList']
}
</script>
<style lang="scss" scoped>
.createUser {
    border-radius: 1px;
    // background-color: #09152f;
 
    main {
        // border: 1px solid #fff;
        text-align: left;
        padding: 0 55px;
        // background-color: #09152f;
        padding-bottom: 50px;
 
        .mainContent {
            display: flex;
            justify-content: center;
            padding-top: 50px;
 
            .el-form-item__content {
                width: 400px;
 
                .el-select {
                    width: 100%;
                }
            }
 
            .optionHandleSp {
                display: flex;
 
                .areaNumber,
                .moreNumber {
                    flex: 1;
                }
 
                .telNumber {
                    flex: 2;
                }
            }
 
            .optionBtn {
                display: flex;
                margin-top: 20px;
 
                .btn {
                    padding: 12px 50px;
                }
            }
 
        }
    }
 
    // &::v-deep .el-textarea__inner {
    //     background-color: #09152f;
    //     border: 1px solid #17324c;
    //     font-size: 10px;
    // }
 
    // ::v-deep .el-form-item__label {
    //     color: #4b9bb7;
    // }
 
    // ::v-deep .el-input__inner {
    //     background-color: #09152f;
    //     border: 1px solid #17324c;
    //     font-size: 10px;
    // }
}
</style>